Skip to content
This repository was archived by the owner on Jun 20, 2018. It is now read-only.

add is_active stringfilter#32

Open
vad wants to merge 2 commits intodisqus:masterfrom
vad:master
Open

add is_active stringfilter#32
vad wants to merge 2 commits intodisqus:masterfrom
vad:master

Conversation

@vad
Copy link

@vad vad commented Jan 4, 2012

With {% ifswitch %} is not possibile to add other conditions, this is a nice complement that can be used if you need to do something like:

    {% if request|is_active:"switchname" and not user.is_anonymous %}
      <my>html</my>
    {% else %}
       <my>other html</my>
    {% endif %}

In this way you don't write <my>other html</my> twice.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant