A
A
AdNahim2016-08-19 13:19:01
MODX
AdNahim, 2016-08-19 13:19:01

How to style resource tree output?

In addition to the options (published / not shown in the menu) , I want to add more, for example, "filled" , and highlight, for example, in green.
So far, it only occurred to me in the plugin to catch whether the checkbox is set and, if so, to style it. So far, we managed to change the styles for custom states. But how to add one more thing - "filled", until I realized it.
I would like to see how the change of the menu item is implemented out of the box (published / not shown in the menu) . And start from this already.
Don't tell me where to look.
Thanks to.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AdNahim, 2016-08-19
@alexanderkx

Understood. /core/model/modx/processors/
resource is getnodes.class.php . In it, just the same, classes are set depending on the state of the checkbox. Didn't make a separate checkbox. And since I did not use the menutitle field , I attached to it. Added to the prepareResourceNode() function :
Before class (.my_class) уже добираюсь плагином на событии OnManagerPageInit, с таким содержимым:
Accordingly in my_style.css нужные стили, например:

.my_class a span {
  color: green;
}

R
Realistic, 2016-08-19
@Realetive

New fields, checkboxes, radiobuttons, etc. can be added by creating TVs and linking them to a specific template. By customizing the forms , they can be placed in the same block as (published / not shown in the menu) .
If you are specifically interested in the possibility of obtaining a status about whether a field is filled or not (longtitle, content, menutitle, etc.), you can use the output filter :empty=`condition`, например, чтобы пометить пункты меню, у которых не заполнено поле «description»:

<a href="" class="link link_green>Я буду зелёной, если не заполнить поле description</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question