2

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.

4

1 回答 1

3

This appears to be a bug. I reproduced the behavior in v7.2 update 2. I just logged the issue with Sitecore Support and will report back with their comments.

Update

Sitecore Support has confirmed that this is a bug. I'm putting a fix together. Stay tuned.

The hotfix is available here: https://github.com/BenGGolden/Sitecore.Mvc.TestingHotfix

于 2014-10-23T05:24:49.227 回答