i'm building website using flask jinja2 templating engine , i'm dynamically building menu ( as described here ): {% set navigation_bar = [ ('/', 'index', 'home'), ('/aboutus/', 'aboutus', 'about us'), ('/faq/', 'faq', 'faq') ] %} {% set active_page = active_page|default('index') -%} <ul> {% href, id, title in navigation_bar %} <li{% if id == active_page %} class="active"{% endif %}> <a href="{{ href|e }}">{{ title|e }}</a> </li> {% endfor %} </ul> now if user logged in want show additional things. @ runtime want add items navigation_bar variable. tried this: {% if g.user.is_authenticated() %} {% navigation_bar.append(('/someotherpage', 'someotherpage', 'someotherpage')) -%} {% endif %} but unfortunately results in following error: templatesyntaxerror: en...