Menu design area and has_children setting


(Jim Smith) #1

Prior to the introduction of the settings.class.has_children option for menu_normal design areas I have used javascript to add a class to top nav items with subpages (arrow indicator).

I’ve been testing the has_children setting with the next version of our template however it seems that the setting/class will only apply when the user is on a page that is part of the same hierarchy.

I’ve been looking for a way to get this showing on pages in other sections but haven’t had any luck. Has anyone else come across this issue and worked out a resolution?


#2

I have the same issue. I’d love to find out how to make the caret appear on all pages that have subpages at the same time


(Douglas (@finnatic at @waikato)) #3

I’m not sure if what we have working is what you’re after or not - http://www.waikato.ac.nz/study/why-study-at-uow is a page that shows the menu_normal setup in one variant of our current design where the current page (why study…) is showing it’s immediate child, but other sibling pages are also expandable e.g. entry requirements, fees etc.

From some work I did to identify the difference between that design and a copy of it that wasn’t quite in sync for menu_normal, the difference was to use ‘always’ instead of ‘on_current’ in the show subs e.g.

<MySource_AREA id_name="Side_Menu" design_area="menu_normal">
    <MySource_SET name="show_subs" id_name="menu_normal_showsubs" var="always" />

I think this is somewhat explained under the show_subs section of https://matrix.squiz.net/manuals/designs/chapters/menu-normal-design-area#Set-Variables


(Jim Smith) #4

Thanks for replying Douglas, unfortunately I already have the show_subs setting set to always which is where I’m mainly confused on the matter - even though there are both the always and on_current settings they both seem to behave like on_current when it comes to the settings.class.has_children option, but work how they should when it comes to actually printing out the items.

Going off topic here but I am curious about how you were able to print the ‘Study’ at the top of the side nav on that page you sent through? I’ve recently done the same and ended up using an asset_lineage design area for it which doesn’t feel like the best implementation.


(Douglas (@finnatic at @waikato)) #5

We’re doing something similar if not the same. The designs have an asset_lineage design area which has print set to no - and then that’s output in the right place in the menu_normal html.


(Jim Smith) #6

That’s exactly the same as what we’re doing. I didn’t think printing the asset_lineage design area under the menu design area would work since I can’t seem to use declared variables inside other design areas so it was a nice surprise when it actually printed out