Show the parent in sub-navigation with Structure
Structure by Travis Schmeisser is an incredibly powerful plugin, but the navigation tag does have limitations. We share a snippet of code to allow the parent to appear within a sub-ul on a navigation.
What the problem is
Structure's own nav tag builds a really nice unordered list of the pages on your structure. Like so...
However with drop-down navigation it is often a better user-experience to add the parent to the top of the sub-ul/dropdown. Why? Simply because some users don't know they can click the top link and miss the page altogether.
Let's just add one!
The Magic Code
Simply add the following code (full disclosure, this is unsupported and rather basic - you may need to tweak for your site) in place of Structure's standard nav tag
What do you think? Can you improve upon it or need a hand? Post in the comments below...
- by Andie Fairlie