Try our conversational search powered by Generative AI!

Custom ContentArea even InEditMode

Vote:
 

Hello!

I'm currently working on a project where I need to put multiple blocks in a contentarea, each block can have it's own look. It's an UL/LI list where each block is rendered as an <li>. I have followed joel abrahamsson example at: http://joelabrahamsson.com/custom-rendering-of-content-areas/ and i works like a charm... almost

When page is published and I drag one block to another place no changes is made in the GUI ( but page is saved in the background and if I publish it, it looks like it should with moved blockes at the right place ). If I'm on a edited page and drag blocks around... the blocks are moveing immediatly like they should... so... does anyone know why FIRST drag doesn't update the GUI on a published page until next try when it is in "unpublished-mode".

@Html.FullRefreshPropertiesMetaData(new[] { "PromoArea1" })

if(Model.CategoryPage.PromoArea1 != null)
{
@:<ul class="block bl-misc group" @Html.EditAttributes(x => x.CategoryPage.PromoArea1)>
foreach(var locCurrentBlock in Model.CategoryPage.PromoArea1.FilteredContents.OfType<LexWebb.Models.Blocks.BaseBlock>())
{
EPiServer.Core.ContentReference locCurrentBlockRef = (locCurrentBlock as EPiServer.Core.IContent).ContentLink;
if (locCurrentBlock is LexWebb.Models.Blocks.TextBlock)
{
<li class="bg-col0" @EPiServer.Editor.PageEditing.DataEPiBlockId="@locCurrentBlockRef">@Html.PropertyFor(b => locCurrentBlock)</li>
}
else if (locCurrentBlock is LexWebb.Models.Blocks.ProductBlock)
{
<li class="bg-col2 promo" @EPiServer.Editor.PageEditing.DataEPiBlockId="@locCurrentBlockRef">@Html.PropertyFor(b => locCurrentBlock)</li>
}
else
{

}
}
@:</ul>
}

    

#74362
Aug 26, 2013 12:00
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.