Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Menu dropdown issue

Started by Muut Archive 11 years ago · 6 replies · 301 views
11 years ago

Hello all,

I've been struggling to remove a submenu dropdown arrow under the "home" menu item at:
http://www.violinteachersingapore.com/

I've set "onpage_menu: false" but am not sure what else might be causing the dropdown.

Any help would be much appreciated. I'm using the photographer theme.

Thanks,
Ivan

11 years ago

If you inspect the partials/navigation.html.twig you can see what is happening.

Well it's doing that because there must be a child page beneath the 'home' page that is not visible. There's a navigation loop that is checking if there are children, and then if so, it displays the <ul></ul> block, but then as it loops over the children it checks visible(). Clearly nothing visible is found, so there's an empty <ul></ul> tag left, which displays as an empty dropdown menu.

This is a little tricky to fix with the loop because you need those ul's outside the for loop, but you don't know there's anything in there until you iterate over it.

What 'folder' do you have under the home folder? Is it needed? Perhaps you can make the check more specific than just .children() check.

11 years ago

Thanks for the quick advice!

This is my current folder structure for '01.home':
https://dl.dropboxusercontent.com/spa/m1a85usyxmh8pt2/2015-11-02-00h54m/index.html

I re-used the theme's structure, just deleting module blocks which I did not need.

Item '03.violin-classes' is rendering correctly as sub-pages as opposed to modules for item '01.home' which is showing the menu even though the subitems are supposed to be modules.

It is rather tricky for me still (as I really dive into grav's internals) as I can't seem to see any extra files but I'm wondering if I can just hardcode to remove the child page if iterating over the 'home' page?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1346 9 years ago
Archive · by Muut Archive, 9 years ago
2 933 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago