kongondo / MenuBuilder

Easily create navigation lists/menus using drag and drop
GNU General Public License v2.0
21 stars 9 forks source link

current_class_level problem #41

Open tyssen opened 5 years ago

tyssen commented 5 years ago

I have a menu builder menu as follows:

- Home
- Services
-- Service 1
-- Service 2
- Blog

The service sub pages aren't actually child pages of Services in the PW tree but they're nested under Services in Menu Builder. Blog is a parent page of numerous child blog entries in the PW tree.

The actual PW tree looks like this:

Home
- Service 1
- Service 2
- Blog
-- Blog page 1
-- Blog page 2

I don't seem to be able to find a value for current_class_level which will show the current class for both Services and Blog when you're on a subpage of that section.

If I set it to 0, I get the class on Blog when you're on a child blog page, but not on Services when you click on one of the dropdown menu items. And if I set it to 2 or 3, it's the opposite, current class is on Services but not on Blog.

Is there any way I can do both?

kongondo commented 4 years ago

Hi @tyssen . Apologies I missed this.

Is your Services in the GUI a ProcessWire page or a Custom menu item?

In my tests I did both; i.e., Services as a ProcessWire page BUT NOT a ProcessWire parent of Service 1 and Service 2; and Services as a Custom menu item. The following were the results.

current_class_level of 2 and 3 work for me for both Services and Blog. 0 only works for Blog BUT NOT for Services. This means 0 only work for natural/ProcessWire parents of child menu items but not for MB-only (GUI) parents.

I'll look into this ASAP.

Thanks.

tyssen commented 4 years ago

I can't actually remember which project this was now. I think I may have ended up doing something with a different body class per page and then targetting each top level link that way.

kongondo commented 4 years ago

Thanks for responding. Glad you sorted it some other way. I'll keep this issue open until I find a solution.

Thanks.