0

I've got a dropdown menu created with Wayfinder in MODx. Basically I'm trying to style specific page links in the dropdown, depending on which template the specific page is using.

So fx. if a page is using template "A", its link in the dropdown gets the class A - and class "A" can be styled.

How would you do this?

I would also like to order the page links in the dropdown, according to their page's template.

Thanks!

Edit:

Basically I'm trying to style specific page links in the dropdown, depending on a template variable I've set up. I've got a TV called [status] which can be set to 1 of 3 radio options when editing a page.

So fx. if a page's [status] is set to "A", its link in the dropdown gets the class A - and class "A" can be styled.

Alexander
  • 1
  • 2

1 Answers1

1

Add class to body tag:

<body class="template-[[*template]]">

And then just use it in css like:

.my_wayfinder_menu {
    /* common style */
} 
.template-5 .my_wayfinder_menu {
    /* only for template with id 5 */
} 
Vasis
  • 2,281
  • 1
  • 16
  • 23
  • The menu is visible across the whole site. This would only work if it was on a specific page right? Or what body tag do you mean? – Alexander Mar 04 '15 at 12:48
  • It works on specific pages assigned to a certain template which contains that tag body specified in the answer. – Vasis Mar 04 '15 at 15:56
  • But, it shoudn't work on specific pages, it should work "globally" in the dropdown menu. Maybe this description is more accurate: Basically I'm trying to style specific page links in the dropdown, depending on a template variable I've set up. I've got a TV called [*status*] which can be set to 1 of 3 radio options when editing a page. So fx. if a page's [*status*] is set to "A", its link in the dropdown gets the class A - and class "A" can be styled. – Alexander Mar 06 '15 at 12:09
  • ok, how about ``? it work on specific pages with specific template and specific tv. – Vasis Mar 06 '15 at 12:16