Try our conversational search powered by Generative AI!

Passing in values when rendering blocks


We have a block which in the view has a div class which requires an ID. E.G:

Some content inside my block

The block sits in a content area which is rendered from it's parent view using


My question is, that block1 id needs to increment in the view for each block - what's generally the best practice to achieve this?

Mar 13, 2017 18:38

Hi James,

You may build your own ContentAreaRenderer to control the surrounding divs, check this:

Or use this AddOn if you use Bootstrap


Mar 13, 2017 21:18

This is perfect sample on how to use block's ID to add it to the wrapping elements:

It was needed for generating menus out of page content.

Luc, that package has nowadays pretty much nothing in common with Bootstrap ;)

Mar 13, 2017 22:21
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.