Open external LINKS in new window, relative LINKS in same window
This is an improvement over commit 90e3ee38f
so it's not necessary to
change the structure of the LINKS setting, just set relative links and
they will be open in the same window, same as the `MAIN_MENU`.
This commit is contained in:
parent
90e3ee38ff
commit
d3d7a8fc7f
1 changed files with 3 additions and 8 deletions
|
@ -116,14 +116,9 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for link_tuple in LINKS %}
|
{% for name, link in LINKS %}
|
||||||
{% if link_tuple|length == 2 %}
|
{# Open external links in new window, relative links in the same window #}
|
||||||
{% set name, link = link_tuple %}
|
<li><a href="{{ link }}" {% if link[:4] == 'http' %}target="_blank"{% endif %}>{{ name }}</a></li>
|
||||||
<li><a href="{{ link }}" target="_blank">{{ name }}</a></li>
|
|
||||||
{% else %}
|
|
||||||
{% set name, link, new_window = link_tuple %}
|
|
||||||
<li><a href="{{ link }}" {% if new_window %}target="_blank"{% endif %}>{{ name }}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue