CMS Development

A2mun
投稿者

Dynamically generating menu pages

解決

Hello, I am wondering if there is logic available in HubSpot through which you can dynamically generate menus. 

 

So if I have template A which generates pages A1, A2, A3, and A4. Then I want a side menu on each of those pages which lists all of the pages created in the same section (template). 

 

I know it is possible to hardcode this, but is there a way that I can get the menu to automatically update once I add page A5, A6, etc.?

 

Thanks!

0 いいね!
1件の承認済みベストアンサー
stefen
解決策
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

Dynamically generating menu pages

解決

@A2mun once you publish the page you should have a the temporary URL to preview it with. I don't believe the menu will show up until it's published. The temp url is usually something like "yourcompany-XXXXX.hs-sites.com"

Stefen Phelps, Community Champion, Kelp Web Developer

元の投稿で解決策を見る

13件の返信
stefen
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

Dynamically generating menu pages

解決

@A2mun Yes it can do this for you. The module you're looking for is called "Advanced Menu Module" and you can change it from static to dynamic by section or dynamic by page. The only difference between the two is if it shows the sibling pages or just the parent pages if I remember correctly.

Stefen Phelps, Community Champion, Kelp Web Developer
0 いいね!
A2mun
投稿者

Dynamically generating menu pages

解決

Hi Stefan, I had initially thought that the advanced menu would work for me but it doesn't seem to. 

 

I did the following

 

1. Created 3 pages: test1, test2, test3 based on a single template

2. Added an advanced menu module named test, which has these 3 pages

3. Added a menu module to the template for these 3 pages, this module is set to dynamic by section

 

However, when I go to the pages and I do not see anything showing up for this menu? What step am I missing?

 

I'm not sure if this is important but these web pages are 'saved' and not published. This is because this is a project under development and is not linked to a live domain. 

 

Thanks!

 

0 いいね!
stefen
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

Dynamically generating menu pages

解決

@A2mun in your site's Content Settings, make sure you have an advanced menu created with those three pages in it. Then, in your template, make sure your advanced menu module is set to use the menu you created.

Stefen Phelps, Community Champion, Kelp Web Developer
0 いいね!
A2mun
投稿者

Dynamically generating menu pages

解決

Hi Stefan, 

 

I can confirm that the advanced menu has been set in content settings

Advanced menu.png

 

And that this is set in the template

 

Advanced menu2.png

 

However when I go to the pages made using this template I see nothing where the menu is supposed to be. 

stefen
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

Dynamically generating menu pages

解決

@A2mun Try moving some of the pages as children to some of the other pages. Then view those pages and you should get an idea of how it works.

Stefen Phelps, Community Champion, Kelp Web Developer
0 いいね!
A2mun
投稿者

Dynamically generating menu pages

解決

I changed the menu structure as you said, however I still don't see anything in the pages where the menu should be. I tried this with both 'dynamic by section' and 'dynamic with page'

 

Subsections.png

0 いいね!
stefen
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

Dynamically generating menu pages

解決

@A2mun hmm, that's strange. Are the pages published? That could be it. And make sure to view the live page.

Stefen Phelps, Community Champion, Kelp Web Developer
A2mun
投稿者

Dynamically generating menu pages

解決

The templates are published but the web pages are not. As I mentioned these pages are not currently connected to a live domain so they can't be published.

 

Are you thinking that is why they are not showing up? Is there a way to bypass this so that I can have the functionality appear before publishing? 

0 いいね!
stefen
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

Dynamically generating menu pages

解決

@A2mun you can still publish the page and it will just give you a hubspot temporary URL. When you connect a domain it HubSpot will create a redirect of the temporary URL to the connected domain so it's not something you really have to worry about.

Stefen Phelps, Community Champion, Kelp Web Developer
A2mun
投稿者

Dynamically generating menu pages

解決

Alright, so I have managed to publish the pages, but am not able to view the live page due to a permissions issue. I will have to get that sorted out. 

 

However, now that they are published I still cannot see the menu showing up in the 'edit' view or in the preview. Is the menu something that will only show up in the live version of the page?

0 いいね!
stefen
解決策
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

Dynamically generating menu pages

解決

@A2mun once you publish the page you should have a the temporary URL to preview it with. I don't believe the menu will show up until it's published. The temp url is usually something like "yourcompany-XXXXX.hs-sites.com"

Stefen Phelps, Community Champion, Kelp Web Developer
A2mun
投稿者

Dynamically generating menu pages

解決
 
A2mun
投稿者

Dynamically generating menu pages

解決

This works well now that it is live, thank you 🙂 

0 いいね!