# Fixed submenu for each page

**URL:** <https://community.hubspot.com/t/fixed-submenu-for-each-page/9270>\
**Category:** CMS Development\
**Created:** [June 27, 2018, 12:36pm UTC](https://community.hubspot.com/t/fixed-submenu-for-each-page/9270 "2018-06-27T12:36:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![italoborges](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/italoborges/32/64675_2.png) [@italoborges](https://community.hubspot.com/u/italoborges)\
**Post date:** [June 27, 2018, 12:36pm UTC](https://community.hubspot.com/t/fixed-submenu-for-each-page/9270/1 "2018-06-27T12:36:24Z")

</div>

Hi,

I have a main menu which has submenus.

The designer made a bit different than usual and I’m having some troubles to figure out how to do this using Design Manager and CSS.

Below what I need to achieve:

 ![Screen Shot 2018-06-27 at 14.32.21.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/f/f0249d6b94e1d6d22c4aac5c15ee7caf2e17d939.png)

Solutions also have a submenu.

I have a **data-template** which it will be using for these inside pages, also for **Solutions**.

To be honest I don’t have a clue how I could achieve this result.

Does someone have an idea?

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [June 27, 2018, 1:37pm UTC](https://community.hubspot.com/t/fixed-submenu-for-each-page/9270/2 "2018-06-27T13:37:32Z")

</div>

Looks pretty! but I don’t envy you in having to code that up.

I just want to be clear on the details here. Does each page you land on have a sticky submenu (always showing) that is different for each parent? Or is this just a typical dropdown menu that doesn’t change across different pages?

* * *

[tim@belch.io](mailto:tim@belch.io)

---

<div class="post-metadata">

**Author:** ![italoborges](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/italoborges/32/64675_2.png) [@italoborges](https://community.hubspot.com/u/italoborges)\
**Post date:** [June 27, 2018, 1:56pm UTC](https://community.hubspot.com/t/fixed-submenu-for-each-page/9270/3 "2018-06-27T13:56:39Z")

</div>

Hi! Thanks for your support! hahaha

Just two pages will have this submenu bar below the menu.

I don’t think it will be possible to do it. The submenu belongs to a menu link, it has an UL inside of it.

To create the submenu based on the layout, the UL had to be outside the menu, below the header container.

She did the layout way before knowing that we would use HubSpot.

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [June 27, 2018, 2:51pm UTC](https://community.hubspot.com/t/fixed-submenu-for-each-page/9270/4 "2018-06-27T14:51:58Z")

</div>

@italoborges

That’s okay, don’t lose hope, there’s lots of creative ways to solve problems in HS using the tools they give you. Here’s how I would approach this.

Go to your advanced menu builder and create 3 menus; 1 for the main nav, and 2 for the 2 unique sub-navs.

Next. Go to the template builder and create a new local custom module.

Next. Add choice field with 3 options (None, Solutions, DataCenter)

Next. In the HTML/HUBL section, add the following (note: change out the id to match your new submenu ids)

```auto
{% if module.sub_menu != 'none' %}
	{% if module.sub_menu == 'solutions' %}
		{% menu "sub_menu_1" id='the_id_of_your_first_submenu', overrideable=False, root_type='site_root', flyouts='false', max_levels='1', flow='horizontal', label='Sub Menu 1' %}
	{% endif %}
	{% if module.sub_menu == 'datacenter' %}
		{% menu "sub_menu_1" id='the_id_of_your_second_submenu', overrideable=False, root_type='site_root', flyouts='false', max_levels='1', flow='horizontal', label='Sub Menu 1' %}
	{% endif %}
{% endif %}

```

Next. Go back to your template and add the new local module

Next. Create a web page based on that template and when you choose a different menu from the dropdown, you will see the submenus change

Next. Use your CSS skills to make it appear the way the designer intended

* * *

If this solution helps; please, mark it as solved 😄 [tim@belch.io](mailto:tim@belch.io)
