Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocks and if don't seem to mix #266

Closed
svanimpe opened this issue Jan 21, 2019 · 0 comments · Fixed by #267
Closed

Blocks and if don't seem to mix #266

svanimpe opened this issue Jan 21, 2019 · 0 comments · Fixed by #267
Milestone

Comments

@svanimpe
Copy link
Member

Both of these don't do what I expected them to do (taken from stencil that extends another one):

{% block title %}
    {% if sort == "new" %}
        {{ block.super }} - Nieuwste spellen
    {% elif sort == "upcoming" %}
        {{ block.super }} - Binnenkort op de agenda
    {% elif sort == "near-me" %}
        {{ block.super }} - In mijn buurt
    {% endif %}
{% endblock %}
{% if sort == "new" %}
    {% block title %}{{ block.super }} - Nieuwste spellen{% endblock %}
{% elif sort == "upcoming" %}
    {% block title %}{{ block.super }} - Binnenkort op de agenda{% endblock %}
{% elif sort == "near-me" %}
    {% block title %}{{ block.super }} - In mijn buurt{% endblock %}
{% endif %}

In the former, only "- Nieuwste spellen" (for example) shows and {{ block.super }} evaluates to nothing.
In the latter, the reverse happens.

What does work is:

{% block title %}
    {{ block.super }} -
    {% if sort == "new" %}
         Nieuwste spellen
    {% elif sort == "upcoming" %}
        Binnenkort op de agenda
    {% elif sort == "near-me" %}
        In mijn buurt
    {% endif %}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants