B
B
be_a_man2017-10-03 15:30:20
JavaScript
be_a_man, 2017-10-03 15:30:20

Modx and pdoTools how to add class depending on page?

How to deduce the active class to a.h6.transition depending on the page we are currently on. Now a crutch on JS
Output
59d382067336a224538805.png
Chunk
59d382173db3a391639042.png
Site
59d382258a09f926676964.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ruslan, 2017-10-03
@be_a_man

Hello, can it be easier to do it through pdoMenu? There are active classes there, you just seem to have a link, pdoResources is redundant.

S
Sanes, 2017-10-03
@Sanes

Condition in a chunk

F
Froggyweb, 2017-10-03
@Froggyweb

Judging by the screenshots, in each li, a snippet with its parent is called, this is somehow very wrong. And it has a bad effect on the reputation of modex.
In other words, it's generally Tin over time, the catalog will have thousands of resources and you pull them all onto the page, and maybe more than once.
Threat class to put the logic of setting the class is simply incomprehensible.
The link is cool. Does it lead to a page with the same drag-and-drop call but with a different template?
In general, among other things, there is pdopage just in case, but in general, the template logic is strange, and even with crutches in the front.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question