Hi there I am looking for help placing a customized menu on a specific page. This is the website in question Pete’s Rubbers. I have this menu:
That I would like to place on this page:
Hi there I am looking for help placing a customized menu on a specific page. This is the website in question Pete’s Rubbers. I have this menu:
That I would like to place on this page:
Hi @Rio_Omnis ,
May I suggest to update code these steps:
{% comment %}
Renders a standard dropdown style menu for the header.
Usage:
{% render 'header-dropdown-menu' %}
{% endcomment %}
Go to Layout/theme.liquid
Refer screenshot to add code below to this file
{% if request.path contains 'duramax' %}
{% assign menu = linklists.duramax.links %}
{% render 'duramax-menu', menu: menu %}
{% endif %}
Hi @Rio_Omnis
I am from Mageplaza - Shopify solution expert.
You can follow these steps to create a custom menu for a specific page.
Go to Online Store > Themes > Edit Code
Under Templates, click “Add a new template”
Choose Page, name it custom-menu, and click “Create” (liquid file)
Replace the content with this:
{% section 'custom-menu-section' %}
Click Save
Under Sections, click “Add a new section”
Name it custom-menu-section
Paste this code:
→ Assign the Custom Template to a Specific Page
Please let me know if it works as expected!
Best regards!
Thank you it worked! just one more thing is there a way to offset it a bit. It’s right at the very edge right now.
As well as the menu does not show up on mobile. I was wondering if you knew how to set it up for mobile?
Do you know why when making the other menus eventhough they work whatever I do to one link shows up in all the other links:
When I do this I have to also place the liquid into a custom liquid section on the page because it does not show up as a section. I also need help with making the menu since i’d have to have submenus I.E: Duramax: 2018-2020 6.7L → Exhaust Systems → link to collection or product. I am not well versed in coding and I would need a little bit of a step by step with atleast on of the menu and submenu items from there I can just replicate the code to make up the rest of the menu.
Hi @Rio_Omnis ,
You can update code below for snippets/duramax-menu.liquid:
And could you please share url store & theme preview that you setup?
{% comment %}
Renders a standard dropdown style menu for the header.
Usage:
{% render 'header-dropdown-menu' %}
{% endcomment %}
Hi I really appreciate all the help here is the link Pete’s Rubbers . With the new code I have gotten the mobile working. Is there any way to make it consolidate like the menu above or something like that so it doesn’t looked stacked? And as you can see it is still placing anything I place in one page and making it part of all the others.
Thanks again for all the help!
Hi @Rio_Omnis ,
You can download code here https://github.com/eboost10/2640367/blob/main/2968481/duramax-menu.liquid to replace code for snippets/duramax-menu.liquid
Create snippets/duramax-menu-drawer.liquid with content here https://github.com/eboost10/2640367/blob/main/2968481/duramax-menu-drawer.liquid
In the layout/theme.liquid update code to
{% if request.path contains 'duramax' and request.page_type == 'page' %}
{% assign menu = linklists.duramax.links %}
{% render 'duramax-menu', menu: menu %}
{% render 'duramax-menu-drawer', menu: menu %}
{% endif %}
Hi you are very helpful thank you so much. Sorry to keep bugging you. Here is what I found when making the adjustments:
On the mobile version the menu does not show all the options.
Is there a way to have the stacked menu in the page and not on a separate header?
I also noticed on the menu on desktop the stacked menu does not hide
And i’m still running into the issue of the collection pages on the menu having the same changes. If I place exhaust system title on the exhaust system it also shows on the other collection pages like the muffler collection page.
Again thank you so much with everything, and taking your time to help me.
Hi @Rio_Omnis
Is there a way to have the stacked menu in the page and not on a separate header? → This one have some complex. B/c your theme is not free theme. I don’t care structure of theme.
I also noticed on the menu on desktop the stacked menu does not hide → you can add code below to end of the snippets/duramax-menu-drawer.liquid file to hide it.
@media screen and (min-width: 990px) {
#MainContent header-drawer {
display: none;
}
}
-And i’m still running into the issue of the collection pages on the menu having the same changes. If I place exhaust system title on the exhaust system it also shows on the other collection pages like the muffler collection page. → you can add exactly condition for each collection
ex: for this collection
https://petesrubbers.com/collections/powerstroke-2020-2022-6-7l-exhaust-systems
You can add code in Layout/theme.liquid
{% if request.path == '/collections/powerstroke-2020-2022-6-7l-exhaust-systems' %}
{% assign menu = linklists.duramax.links %}
{% render 'duramax-menu', menu: menu %}
{% render 'duramax-menu-drawer', menu: menu %}
{% endif %}