wblz
November 23, 2017, 3:06pm
1
Hello everyOne, first here
I have a custom theme with this code inside - navigation.html.twig
{% for link in site.links %} {% if link.url | contains('http') %} {% set domain = '' %} {% else %} {% set domain = base_url_absolute %} {% endif %} <li><a href="{{ domain }}{{ link.url }}" {% if link.url | contains('http') %}target="_blank"{% endif %}>{{ link.title }}</a></li> {% endfor %}
Inside a Grav theme default antimatter - navigation.html.twig
{% for page in pages.children.visible %} {% set current_page = (page.active or page.activeChild) ? 'active' : '' %} <li class="{{ current_page }}"> <a href="{{ page.url }}"> {% if page.header.icon %}<i class="fa fa-{{ page.header.icon }}"></i>{% endif %} {{ page.menu }} </a> </li> {% endfor %}
but this applied to my templates does not return anything…
wblz
November 24, 2017, 12:01am
2
It’s still not clear where is the problem is, but reinstalling the new GRAV based clean with Antimatter and then uploading my ftp theme > actived all works perfectly.
Obviously the skeletons used earlier has some setting that escapes me.
If I find the setting that turns off page.active
,
I’ll go back and tell it if it comes back to other people.
wblz
November 24, 2017, 3:23pm
3
Final
{% for page in pages.children %}
{% set current_page = (page.active or page.activeChild) ? 'active' : '' %}
<li class="*{{ current_page }}">
{% if page.home %}
<a href="{{ page.url }}">{{ 'Home' }}</a>
{% else %}
<a href="{{ page.url }}">
{% if page.header.icon %}<i class="fa fa-{{ page.header.icon }}"></i>{% endif %}
{{ page.title }}
</a>
{% endif %}
</li>
{% endfor %}
1 Like