Skip to content
Grav 2.0 is officially stable. Read the announcement →
Content & Markdown

Top menu active stopped working on scrolling with modular

Started by Miedziaq 8 years ago · 0 replies · 635 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, 10 months ago
6 726 10 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 625 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 547 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 472 1 year ago
Content & Markdown · by belthasar, 2 years ago
4 817 2 years ago