Rendering ContentArea as list

Vote:
 

Hi

Is it possible to create a custom renderer for ContentAreas without swapping out the default one entirely? In my case I want to render it as a

    with
  • -elements.

I can solve this by just specifying CustomTag and ChildrenCustomTagName (naming inconsistency right there). But I also want to specify an id on both children and the contentarea itself as well as some aria tags for accessibility reasons but the default implementation doesn't even seem to give me the possibility to add something as simple as an ID?

PropertyFor heavily lacks options for this and @Model.ContentArea just renders the names of the children.

#151722
Aug 04, 2016 19:02
Vote:
 

Then you have three options:

1. Either implement your own content area renderer with support for this. Most fun option but takes most time...

2. Render the blocks inside the content area manually by looping through the FilteredItems collection on the property.

3. Change your gui implementation to not require ids etc. I normally go for this option and spend my hours on other functionality to be honest :)

#151729
Aug 04, 2016 23:41
Vote:
 

Ok I'll just skip the list then, and add a couple of extra wrapping divs around stuff. I don't really love littering my DOM with extra elements but still need my aria-attributes. I could probably afford to create my own content area renderer but I might end up in a situation where I need to rewrite every single renderer for concistency.

Really poor implementation of PropertyFor though since it apparently delegates to DisplayFor and should enable me to add whatever custom attributes to an element that I want (aria, data, id, ng, whatever).

How'd you guys handle this in Angular with the ng-? Wrappers also?

(Also, thanks for the answer :)) 

#151737
Edited, Aug 05, 2016 11:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.