getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

[typhoon] Mobile menu navigation only displays primary menu (not onpage menu) #429

Closed lic0san closed 7 months ago

lic0san commented 8 months ago

Suggested patch to display the modular entries on one-page configuration :

in /templates/patials/mobile-navigation.twig

replace

<ul class='{{ classes.root }}'>
    {{ macros.nav_loop(theme_full_menu(), classes, alpine, svg) }}
</ul>

by

<ul @click="show_mobile_nav = false" class='{{ classes.root }}'>
{% if show_onpage_menu %}
  {{ macros.nav_loop(theme_onpage_menu(), classes, alpine, svg) }}
{% else %}
  {{ macros.nav_loop(theme_primary_menu(), classes, alpine, svg) }}
{% endif %}
</ul>
rhukster commented 7 months ago

Typically an on-page menu (jumping around on the same page), doesn't make much sense on. mobile. That's because to get to a sectxion you have to activate the mobile menu, (1st click) and then find and click the section (2nd click). Compared to just flicking/scrolling to the section which is more intuitive and quicker.

But what you have done is the correct solution if you did want that to display.

lic0san commented 7 months ago

Indeed it makes sense ! I just though it was confusing to have the navigation menu to present a different behavior in mobile view.