CMS Development

ALeinweber
Member | Gold Partner
Member | Gold Partner

How to create dynamic menu by parent page

SOLVE

Hi,

i want to get all subpages of a parent page and tried to use menu() Hubl function. 

How to setup the Hubl menu function to get all subpages of a specific page like

parent page: /marketing

all subpages like:
/marketing/test1

/marketing/test2

/marketing/test3

Thanks

0 Upvotes
1 Accepted solution
Jnix284
Solution
Hall of Famer

How to create dynamic menu by parent page

SOLVE

@ALeinweber parent/child pages are currently manually created/maintained with the exception of dynamic pages, you can set a child path for the dynamic page that will create this same relationship, and blogs where this is created automatically. The capabilities surrounding parent/child pages is fairly limited - I don't think it's possible to do what you're looking for, if @Anton isn't able to help further you might also try asking in the HubSpot Developer Slack in the corresponding channel.


If my reply answered your question please mark it as a solution to make it easier for others to find.


Jennifer Nixon

View solution in original post

0 Upvotes
3 Replies 3
Anton
Thought Leader | Partner
Thought Leader | Partner

How to create dynamic menu by parent page

SOLVE

Hui @ALeinweber

do you mean dropdowns like the "About" menu item in this screenshot?

Bildschirmfoto 2024-06-24 um 13.14.52.png

 

If so, you can set this in the global navigation settings by drag&drop the menu items that you'd like to have as dropdown items onto/below the desired nav item. You'll find the navigation settings here:

Hub settings(gear icon top right) -> Content -> Navigation menus -> YOUR MENU

Bildschirmfoto 2024-06-24 um 13.16.07.png

 

Once created open your global header and select the desired menu. Save/Update/Publish -> done

 

 

best, 

Anton

Anton Bujanowski Signature
0 Upvotes
ALeinweber
Member | Gold Partner
Member | Gold Partner

How to create dynamic menu by parent page

SOLVE

thanks for your response.

But no, i want to query dynamicaly all Subpages of a page, without defining by hand a menu.


My idea was to create a menu with a parent page like "Marketing" and query all subpages with the menu() Hubl function. I thought root_type: "parent" or "parent_page" would do the work, but its always empty.  How to setup this function to get all subpages of "/marketing"?

Bildschirmfoto 2024-06-24 um 13.41.01.png

 

 

 



Jnix284
Solution
Hall of Famer

How to create dynamic menu by parent page

SOLVE

@ALeinweber parent/child pages are currently manually created/maintained with the exception of dynamic pages, you can set a child path for the dynamic page that will create this same relationship, and blogs where this is created automatically. The capabilities surrounding parent/child pages is fairly limited - I don't think it's possible to do what you're looking for, if @Anton isn't able to help further you might also try asking in the HubSpot Developer Slack in the corresponding channel.


If my reply answered your question please mark it as a solution to make it easier for others to find.


Jennifer Nixon
0 Upvotes