Domanda

If I add ApplicationContent to a region on a feincms page, how do I update the feincms_page's context?

Use case

Changing a feincms_page's title to the application content's title

È stato utile?

Soluzione

Use the fragment templatetag

app template:

{% fragment request "frag_title" %} my title {% endfragment %}

inherited template:

{% if request|has_fragment:"frag_title" %}
    <title>{% get_fragment request "frag_title" %}</title>
{% else %}
    <title>{{ feincms_page.title }}</title>
{% endif %}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top