Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Top menu active stopped working on scrolling with modular

Started by Miedziaq 8 years ago · 0 replies · 705 views
8 years ago

Hello,

after some changes in menu and make site modular, menu stopped highlighting active item..

{% for module in page.collection() %}
{% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
<li><a class="{{ current_module }}" href="#{{ _self.pageLinkName(module.menu) }}">{{ module.menu }}</a></li>
{% endfor %}

this code showing the menu well, but all the modules are inactive on scrolling or click... how to fix it?

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 12 months ago
6 1205 12 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 966 1 year ago
Content & Markdown · by Jan L'Am, 2 years ago
4 845 2 years ago
Content & Markdown · by Leonardo, 2 years ago
3 768 2 years ago
Content & Markdown · by belthasar, 2 years ago
4 1184 2 years ago