I have tested and confirmed the following works with a Nav block containing a Menu block and a standalone Menu block.
The code does two things:
Makes nav/menu items highlight when they are logically hierarchical ancestors based on the URL
e.g. https://site.com/type will be highlighted if what is being currently viewed is a page or post with the url https://site.com/type/some-page-or-post
Makes nav/menu items highlight when they are hierarchically related by custom taxonomy
e.g. when a viewing a post, the taxonomy terms related to it will be highlighted.
This may require tweaking for some custom configurations but should cover most normal hierarchical scenarios.
Firstly, you will need to add the below custom code to your site:
Thank you StrangeTech, I really appreciate all your work! Unfortunately, I am not getting it to work.
Just for clarification - If I use the Cwicly Menu block I need to add the php code through a code snippet. Then add a class to the menu block.
From my understanding, only the first screenshot “For Menu” is relevant if using the default Cwicly Menu Block . Do I need to add the second relative style “current sub nav links” as well?
Once you have added the custom code and added global class to the Menu block that has the For Menu relative style, it should work without requiring any other changes.
If you share a link to your site, it will be easier and faster for me to help you work out what the issue is.
Can you show how you are adding the custom code (it doesn’t seem to be applied).
Please add a relative style rule for a.current-page-parent (after a comma in the current menu links relative style) - this should make your work menu item highlight straight away.
OK, I don’t know why the code is not applying to your menu, but I have worked out that the relative styles are being overridden because you are setting the initial colour and hover colour using the built-in Menu styles.
Here is the solution:
For you relative styles in your navigation global class, please update them to be the following:
I was hoping to give you this in a quick way so you could input it in free-form, unfortunately there appears to be a bug in Cwicly that is preventing this.
I am really busy at the moment, as soon as I have a moment, I will update my version and send you a screenshot of how to do it.