Answers for "nav bar activate in jinja"

0

nav bar activate in jinja

{% set navigation_bar = [
    ('/', 'index', 'Index'),
    ('/downloads/', 'downloads', 'Downloads'),
    ('/about/', 'about', 'About')
] -%}

{% set active_page = active_page|default('index') -%}
...
<ul id="navigation">
    {% for href, id, caption in navigation_bar %}
    <li{% if id == active_page %} class="active"{% endif
    %}><a href="{{ href|e }}">{{ caption|e }}</a>
    </li>
{% endfor %}
</ul>
Posted by: Guest on June-04-2020
0

nav bar activate in jinja

{% extends "layout.html" %}
{% set active_page = "index" %}
Posted by: Guest on June-04-2020

Browse Popular Code Answers by Language