I want to add some classes to each block that generated in custom region automatically.
For example I want to all blocks that generated within sidebar-left have some special classes and in addition I don't want to those blocks in other regions have those classes.
I try to use something like below code to add desired class to each block that's generated in sidebar-left:
region--sidebar-left.html.twig
{%
set classes = [
'region',
'region-' ~ region,
]
%}
{% if content %}
<div{{ attributes.addClass(classes) }}>
{{ content }}
</div>
{% endif %}
But it seems there isn't any loop functionality Like below to I can use for each blocks and add my desired classes to them:
{% for item in items %}
<div class="my-desired-class">
{{ content }}
</div>
{% endif %}