eZ Platform Discussions

[ee] Page Block - Access parameters.editorial_mode in block tempate


#1

Bonjour à tous.

In the layout tamplates there is a parameters variable that contains an editorial_mode key that allows you to modify the behavior of the template if it is in edit or view mode.

I don’t find this variable in the block templates.

I would have liked to find it again, because I have a block that displays nothing but defines JS variables for the front. As a result, in the studio this empty block is blunt.

style_block.html.twig

{% if parameters.editorial_mode %}{# !!! Variable "parameters" does not exist. #}
        <div>
            Style de ligne : {{ style|default('') }}
        </div>
{% endif %}
<span data-style="{{ style|default('') }}"></span>