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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Top menu active stopped working on scrolling with modular

Started by Miedziaq 8 years ago · 0 replies · 511 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, 8 months ago
6 100 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 187 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 148 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 63 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 259 1 year ago