Answer the question
In order to leave comments, you need to log in
[[+content_image]]
How to add a class to a menu item in MODX?
Good afternoon.
We have two templates:
1. Main (landing)
2. All other pages of the site.
The site header is the same on all pages. In both templates, navigation is rendered via [[$nav]].
In the chunk itself, the usual HTML of the form:
<ul>
<li class="active">Меню 1</li>
<li>Меню 2</li>
<li>Меню 3</li>
<li>Меню 4</li>
</ul>
Answer the question
In order to leave comments, you need to log in
Modx has a lot of plugins. Use something like the most basic classic wayfinder. Or pdomenu, or whatever)
These plugins have options to configure any navigation state. Specify the active element, hide the current section or root, and so on.
You can connect and write classes on top of styles out of the box, you can implement your own templates for all occasions.
i--gu.ru/wayfinder for example. Or read on the modx documentation site
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question