Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Access child' child element in CustomContentAreaRenderer


Is it possible to access child elements of ContentArea children for manipulating their attributes? I have CustomContentAreaRenderer with overriden RenderContentAreaItem method. I have CurrentItem, its index and content but can't access to its children.

Has anybody faced similar problem? 

Edited, May 16, 2018 11:20

What do you mean with ContentArea children? You should probably just manipulate the wrapping element for the whole property and the wrapping element for each item in the content area renderer. If you want to manipulate anything lower in the hierarchy you should do that in each content item renderer.

If I understand you correctly, then the easiest solution would be to override

void BeforeRenderContentAreaItemStartTag(TagBuilder tagBuilder, ContentAreaItem contentAreaItem)

and then add the attributes to the tagBuilder. 

May 16, 2018 15:16

Thank you, Johan!

May 16, 2018 15:22
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.