I am using Flask/Jinja2 and Bootstrap 3.
I\'d like to add class=\"active\" to the current navigation element.
Those elements are stored in
Your code just defines a macro over and over again, it doesn't render anything. Avoid reading request.endpoint and use base templates to do this.
base.html
{% block content %}{% endblock %}
there.html
{% extends "base.html" %}
{% block nav_there %}active{% endblock %}
{% block content %}
No matter where you go, there you are.
{% endblock %}
The base navigation defines empty nav_ blocks in the li class and the sub template sets the relevant one to active. You can extend this as far as you want to have sub-navigation within pages too.