{# Jinja2 variable scope visibility workaround: declared as a list so it is available to inherited templates #} {% set active_mx_page = [] %} {%- for mx_rule, mx_page_name in mx_processing_context.items() %} {% set endpoint = '/' + mx_rule %} {%- if endpoint in local.request.path -%} {% do active_mx_page.append(endpoint|lstrip_slash|safe) %} {%- endif -%} {%- endfor -%}