I'm trying to implement web solution with sitecore 7.x as a content manager. My web application is a MVC solution. I've installed Sitecore and set up MVC project.
The problem is that AB/MV tests don't work when using *.cshtml
layout with @Html.Sitecore().Placeholder(...)
and ControllerRenderings
.
I have Item defined with layout set to LayoutMVC.cshtml file.
@inherits System.Web.Mvc.WebViewPage
@using Sitecore.Mvc
<html>
<body>
MAIN:@Html.Sitecore().Placeholder("main")END
</body>
</html>
I render ControllerRendering into main
placeholder and I want to add variation to component rendered here. Basicaly I can add a variation using Page Editor and everything is fine until I click save in Page Editor. Then the test is saved but I cannot see first variation anymore. I see the content from the original item. I can choose variations but instead of Variation1 there is a Default content.
When I start a test it doesn't work at all. Always renders original Item.
The same test works when I use /sitecore/Layout/Layouts/Sample Layout
which is an aspx layout but I need to use MVC @Html.Sitecore().Placeholder(...)
method as I want to render placeholders dynamically later.
Additionaly DMS works fine for this configuration. I can personalize content.