Setting the selected tab from the template

How to select the main template tabs status from a child template using Django:

base.html:

{% block tabs%}
<ul class="menu">

<li class="{{ SEARCH_TAB_STATUS }}"><a href="/">
<span>{% trans "search_professional" %}</span></a></li>
<li class="{{ REGISTER_TAB_STATUS }}"><a href="/register">

<span>{% trans "want_work" %}</span></a></li>
</ul>
{% endblock %}

register.html:

{% extends "base.html" %}

{% block tabs%}
{% with "inactive" as SEARCH_TAB_STATUS %}
{% with "active" as REGISTER_TAB_STATUS %}
{{ block.super }}
{% endwith %}
{% endwith %}
{% endblock %}

Nice one!!!

Enjoyed reading this post?
Subscribe to the RSS feed and have all new posts delivered straight to you.
  • http://www.mediciepc.it/entry.php?156-Niezjawiskowego-modusy-promocji Ophelia Blaski

    I appreciate, cause I found exactly what I was looking for. You have ended my four day long hunt! God Bless you man. Have a nice day. Bye