Episerver 11 - DisplayTemplates for LinkItemCollection


Alloy, Episerver 11.10.1.

On StartPage, I've created a new property:

    GroupName = SystemTabNames.Settings,
    Order = 100)]
public virtual LinkItemCollection MyProperty{ get; set; }

Under Views/Shared/DisplayTemplates, I've created a new view - MyUiHint.cshtml

If I use @Html.PropertyFor(x => x.CurrentPage.MyProperty) inside Views/StartPage/Index.cshtml, everything works as expected. Episerver will use MyUiHint.cshtml to render the property.

However, if I want to make MyProperty available inside LayoutModel and use @Html.PropertyFor(x => x.Layout.MyProperty), Episerver will use the default template instead of MyUiHint.cshtml. If I then click on the property in On-Page editing mode and close the popup, Episerver will switch to MyUiHint.cshtml. However, as soon as I switch the view (for example, go to All Properties view and then back to On-Page editing view), Episerver will again use the default template instead of MyUiHint.cshtml.

Is this a known issue?

Dec 03, 2018 19:58


Dec 07, 2018 13:31
* 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.