Hello!
I am trying to get a different image to display in my nav depending on the page I am currently on.
<ul class="nav-links">
{% for page in pages.children.visible %}
{% set current_page = (page.active or page.activeChild) ? 'active' : '' %}
<li class="{{ current_page }}">
{% if page.header.title == 'Home' %}
<a href="{{ page.url }}" class="navlogolink">
{% if page.slug == '' %}
<img src="../images/symbol_white.png" class="navlogo" />
{% else %}
<img src="../images/symbol_red.png" class="navlogo" />
{% endif %}
</a>
{% else %}
<a href="{{ page.url }}" class="navlink">
{{ page.menu|upper }}
</a>
{% endif %}
</li>
{% endfor %}
{% for mitem in site.menu %}
<li>
{% if page.header.title == 'Home' %}
<a href="/" class="navlogolink">
<img src="../images/symbol_white.png" class="navlogo" />
</a>
{% else %}
<a href="{{ mitem.url }}" class="navlink">
{{ mitem.text }}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
In the code above if I am at the root '/' it should display the white image, otherwise the red. I would also like to be able to add more pages to have the white image with an OR in the if check.
Any help would be appreciated.
Thanks!