Hi,
I am trying to create a grid layout with a number of named regions. In my thymeleaf view file I’d like to iterate over these regions like this:
<div data-th-each="region : ${regions}" data-th-remove="tag">
<div data-portal-region="${region.name}">
<div data-th-each="component : ${region.components}" data-th-remove="tag">
<div data-portal-component="${component.path}" data-th-remove="tag"/>
</div>
</div>
</div>
The regions are provided as an array to the view upon rendering. However, it seems that the ${region.name} in the data-portal-region attribute is not evaluated as code, and appears in the rendered html view as a string:
<div data-portal-region="${region.name}" class="ui-sortable"></div>
Clearly this prevents my layout from working properly in edit mode.
Why is the ${region.name} not evaluated as expected when applying it to data-portal-region name? When printing it as text it prints the correct region name.
Are there any nice tricks for programmatically setting region names?