P
P
Pavel2021-02-17 12:17:00
MODX
Pavel, 2021-02-17 12:17:00

How to change a single modx menu item?

There is a top menu on the site with cms MODX. Data is entered into the top menu automatically via pdoMenu. I'm not entirely savvy about this myself, but I want to highlight the separate item "Tours with cashback" with a different color through CSS and move it to the right. I don’t understand how to do this if the menu is assembled automatically on the entire site and classes are assigned automatically. Maybe someone knows somehow separately whether it is possible to separate one item.
602cdefcbe3e3544506867.png
602cdece0d7fb686457540.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Lunegov, 2021-02-17
@alelunegov

You can do so.
In the tpl parameter of the snippet, specify the name of the chunk, and in the chunk itself, write code that checks for the resource id, and if it matches, then substitute the class.


Chunk topMenuItem.tpl :
<li class="header__nav-item">
     <a href="" class="header__nav-link link_btn"></a>
     
</li>

PS If you want an answer by code, then show the code in text format, not as a picture.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question