Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 884 Bytes

ngbm_render_rule_condition.rst

File metadata and controls

32 lines (19 loc) · 884 Bytes

ngbm_render_rule_condition

This function is used to render a rule condition:

{{ ngbm_render_rule_condition(condition) }}

This will render the provided condition in the view context of the template from which you called the function or in the default view context if the calling template is not rendered by the Netgen Layouts view layer.

You can transfer a list of custom parameters to the function, which will be injected as variables into the condition template:

{# my.html.twig #}

{{ ngbm_render_rule_condition(condition, {'the_answer': 42}) }}

{# condition.html.twig #}

{{ the_answer }}

Finally, you can render the condition with a view context different from the current one:

{{ ngbm_render_rule_condition(condition, {}, 'my_context') }}