Is it possible to have Wayfinder where some of the Parent Pages are clickable and some are non-clickable. Below is the tree layout for my website;
-
Single Page (Clickable)
-
Parent Page (Clickable)
… Child Page (Clickable)
… Child Page (Clickable)
-
Parent Page (Non Clickable)
… Parent Inner Page (Clickable)
… … Child Page (Clickable)
… … Child Page (Clickable)
-
Parent Page (Non Clickable)
… Child Page (Clickable)
… Child Page (Clickable)
-
Single Page (Clickable)
I think you need to write some javascript for that as it doesn’t seem like you have a common rule for when a page should be clickable.
That being said, from a usability standpoint I would argument against such a structure, as your users might get confused when or why a parent is clickable or when it’s not. In general you want to have continuity there. But I obviously don’t have much insight in your project, so there might be a valid reasoning for what you’re doing
Also if you’re not tied to Wayfinder, you can check out pdoMenu, as it has almost the exact same syntax but a few more options available.
Maybe you can use the link_attributes placeholder for this?
How does that work? Would you have a sample?
With both Wayfinder and pdoMenu, the default template inserts the “link attributes” field from a resource into the opening anchor tag as-is. So you could use this field to assign a class, ID or data attribute to the links you don’t want clickable and then target them with JS. If you’re using a custom template in the snippet call you’ll need to make sure the placeholder [[*link_attributes]]
is in the right place.