Try our conversational search powered by Generative AI!

Has something changed with ContentArea rendering in edit mode?


I have a SocialLinks content area defined on start page.

This is how I render it in the footer.cshtml, placed under Shared/Framework, rendered with Html.RenderPartial on a layout:

@Html.PropertyFor(m => m.SocialLinks, new { CustomTag = "ul", ChildrenCustomTagName = "li" })

This works well only on start page. However, on all other pages, the surrounding ul tag is missing. Rendering in view mode is fine.

I have tested this in two latest versions, it doesn't work in any of them.

Any ideas on what've missed?

Edited, May 25, 2017 16:53

Same thing happens in Alloy tech templates, if I add  public ContentArea Something { get; set; } to LayoutModel and assign it  Something = startPage.MainContentArea in PageViewContextFactory:

May 25, 2017 17:13

I think I've reported a simular bug, where content areas are not always wrapped with an element when they are rendered in another context/page. This only happens in edit mode. My understanding was that content areas should ALWAYS get wrapped, but that's not the case. The bug was dismissed as "by design".

I would like this to get fixed, so please report it as well :) Reported another bug in the language add-on, it was also dissmed, but then a few months later it was fixed anyway. I can try to find my case number if you like?

Edited, May 25, 2017 19:39

My understanding as well, I don't understand why the behavior would be different by design in another context/page. Especially, since it worked this way until some version.

I have a couple of scenarios when I really need this, so if I upgrade one of the older solutions, I'll get into a bunch of issues. 

OK, then I open a new support case, do send me your case number to refer to it.

May 26, 2017 9:23

Submitted and referred to this post.

May 26, 2017 9:28

We had this problem in an older version (9.7.3) though, but it's probably related somehow anyway. My ticket number was 41852 in the developer support and they also created this bug CMS-4521.

May 26, 2017 9:28

Their response was basically, Html.PropertyFor is not intended for this use. Fix it on your own instead. 

We also have the same issue with LinkItemCollection, it's not always wrapped either. So by default you won't get an UL in some cases (if you're using the default renderer).

May 26, 2017 9:33

Had more luck, bug is reported and accepted :)

Upvote here!

Jun 02, 2017 11:18

Great news :)

Jun 02, 2017 11:32

Our proudct developer has found out that the surrounding tags are missing on other pages, but on the start page too. They are missing in edit mode, because the property is not editable.

Try to add HasContainer = false and add tag manually in the footer.

    @Html.PropertyFor(m => m.Layout.Something, new { CustomTag = "ul", ChildrenCustomTagName = "li", HasContainer=false })
Edited, Jun 08, 2017 13:40

So how do we fix properties that should be editable, because that's our case?

Jun 08, 2017 14:06
* 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.