November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
Have you tried to add another UIHint? Like this:
[UIHint(UiHint.NoWrappersContentArea, PresentationLayer.Website)] [UIHint("ContentArea", PresentationLayer.Edit)] public virtual ContentArea MainContentArea { get; set; }
I usually don't want the editors to have one experience in Edit mode and another in view mode so I try to avoid it as much as possible. I know it works on some Property types though. I guess ContentArea is not one of them if you can't get it to work. If I need a special display template I try to make sure it is supported in edit mode as well. You can add attributes to the children of the content area to make them editable. Just add data-epi-block-id="123" where the number is a ContentReference.
Thanks for the suggestion of using data-epi-block-id. That works perfectly and gives me editing capabilities again when using a display template.
However I have to add this attribute to all my blocks, which I do not prefer. But I will definitely keep this in mind for future usage.
For now I will use a quick workaround which I should have thought of immediately:
@model EPiServer.Core.ContentArea @if (PageEditing.PageIsInEditMode) { Html.RenderContentArea(Model); } else { Html.RenderNoWrappersContentArea(Model); }
Thanks for your support!
Hi,
I'm trying to create a custom view for a content area that should only be used in view mode.
Logical solution would be
Just for the sake of testing I created this view in the DisplayTemplates folder
Expected behaviour would be that this custom view would only be used in view mode (PresentationLayer.Website). However it is used in both view and edit mode.
Am I missing something here?
Thanks,
Mark