Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ulmus on github.
  • I am jensalm (https://keybase.io/jensalm) on keybase.
  • I have a public key ASCtDKdELgA3ZLDsrlc5jFHRKOsN_hNKgERQzlPrVRq0AQo

To claim this, I am signing this object:

@ulmus
ulmus / navbar.html
Last active August 29, 2015 14:15
A basic way of implementing a static navbar in django with the current page marked as active
<ul class="navbar">
{% for item in navbar %}
<li {% if item.name==active_navigation%}class="active"{% endif %}><a href="{{item.url}}">{{item.label}}</a></li>
{% endfor %}
</ul>
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best