Re: Different menus for specific collection-pages (Enterprise Theme)

Different menus for specific collection-pages (Enterprise Theme)

generalharley
Visitor
2 0 0

Hi everyone! Were working on the Enterprise theme, and have a load of custom collection templates that we use to alter each collection page. We would like to showcase different menus for different types of collections on their respective pages, and have found / altered the below code to hopefully show what we aim to achieve.

(****main-menu handle is NOT the main menu, not sure if this breaks other code and if I should remake the menu and change the handle to something more fitting like "onderdeel-menu")

{% if collection.handle contains 'onderdeel' %}
{% include 'main-menu' %}
{% if collection.handle contains 'onderhoud' %}
{% include 'onderhoud-menu' %}
{% if collection.handle contains 'overig' %}
{% include 'overig-menu' %}
{% else %}
{% include 'homepage-menu' %}
{% endif %}

The question with the above code is (if it'd work as intended), where should we insert it? If its theme.liquid or header-liquid, what place / rule within the code should we put it in and how to prevent syntax errors?


Appreciate any input!

Replies 2 (2)

Dan-From-Ryviu
Shopify Partner
10868 2143 2277

You can try to add code into main-collection.liquid or something like that in your Sections folder in Online Store > Themes > Edit code

 

- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

gr_trading
Shopify Partner
1996 147 205

Hi @generalharley ,

 

We have implement the same in DAWN theme may be logic could help in your theme too.

 

Please refer to the below video for instructions.

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee