Nested pages/URL structure in Menus
-
Hi, I would like to nest some pages/URLs like so:-
/clothing/shoes/product1 /clothing/shoes/product2
What is the correct way to do this?
It seems that if I enter
clothing/shoes/product1
orclothing/shoes/product2
as the page slugs then the URIs saved against in the database against the respective menu item become/clothing/shoes/product1
and/clothing/shoes/product2
if the menu items have a parent, and so the URL is rendered like so:/en//clothing/shoes/product1
and/en//clothing/shoes/product2
.Strange thing is that if the above pages are added to the top level menu (i.e. no parent) then the URIs are saved as defined (no leading /)
-
Seems to me that the Menu module just isn't fit for purpose when using sub menus - am I wrong?
I have been testing with even simple pages
/test
and/test-child
added to a menu with the following structure:- test - test-child
..and neither of the methods
$item->hasActiveOnChild()
or$item->getActiveStateFromChilds()
recognise thattest
is active when the current page istest-child
.I suspect I would have saved half a day if i just hard coded the menu into the views!
Am I missing something? Should I be using routes? If so, how do i use routes on pages?
Thanks.
-
Hi,
I don't recall it not working. Though I don't use menus very often as I prefer making them manually.
Though if you say it's broken, it's worth fixing instead of just saying it's broken.
-
@nWidart said in Nested pages/URL structure in Menus:
Hi,
I don't recall it not working. Though I don't use menus very often as I prefer making them manually.
Though if you say it's broken, it's worth fixing instead of just saying it's broken.
I didn't say it's broken, I just asked if I was wrong in thinking it doesn't work properly with sub menus, and if i should be doing something differently. Happy to try and fix it once I know it's broken and it's not just me using it incorrectly.