Try our conversational search powered by Generative AI!

Has something changed with ContentArea rendering in edit mode?

Vote:
 

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?

#178896
Edited, May 25, 2017 16:53
Vote:
 

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:

https://prnt.sc/fbzyvv

#178898
May 25, 2017 17:13
Vote:
 

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?

#178899
Edited, May 25, 2017 19:39
Vote:
 

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.

#178914
May 26, 2017 9:23
Vote:
 

Submitted and referred to this post.

#178916
May 26, 2017 9:28
Vote:
 

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.

#178917
May 26, 2017 9:28
Vote:
 

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).

#178918
May 26, 2017 9:33
Vote:
 

Had more luck, bug is reported and accepted :)

Upvote here!

http://world.episerver.com/support/Bug-list/bug/CMS-7635

#179181
Jun 02, 2017 11:18
Vote:
 

Great news :)

#179182
Jun 02, 2017 11:32
Vote:
 

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.

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

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

#179335
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.