Opticon Stockholm is on Tuesday September 10th, hope to see you there!
AI OnAI Off
Opticon Stockholm is on Tuesday September 10th, hope to see you there!
Can you simply use @Html.Partial("Views/Shared/DisplayTemplates/_CustomContentArea.cshtml", Model.MainBody) instead?
If you want to skip extra element, soon renewed package will be released :)
https://github.com/valdisiljuconoks/optimizely-advanced-contentarea#skip-item-wrapper-element
But did you check what template renderers you have registered on MainBody
type? Using just Tag
- might not work properly. You can check templates nicely if you install EPiServer.DeveloperTools package (there is separate section for those).
Hi Team,
I have below tag helper code used to avoid extra divs for blocks in CMS11. but after upgrade to new CMS12 solution below code not working. Can you please let us know what is missing here to work in CMS12 framework?
<div class="row">
@Html.PropertyFor(m => m.MainBody, new { Tag = "_CustomContentArea" })
</div>
_CustomContentArea.cshtml this view exists under Views/Shared/DisplayTemplates
@using EPiServer.Core
@using EPiServer.Web.Mvc.Html
@model ContentArea
@{
if (Model != null && Model.FilteredItems != null)
{
foreach (var item in Model.FilteredItems)
{
Html.RenderContentData(item.GetContent(), true);
}
}
}