Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Top menu active stopped working on scrolling with modular

Started by Miedziaq 8 years ago · 0 replies · 666 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, 11 months ago
6 962 11 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 764 1 year ago
Content & Markdown · by Jan L'Am, 2 years ago
4 676 2 years ago
Content & Markdown · by Leonardo, 2 years ago
3 602 2 years ago
Content & Markdown · by belthasar, 2 years ago
4 985 2 years ago