Recently I worked on a Shopify site (moderno theme) that required a multi-level navigation system for their extensive product inventory. Here are the steps:
1. Find a good menu-ing system
Dynamic Drive, Dev Snippets and CSS Play are good places to look. This is the fun part, but be careful as you can spend many hours wading through the plethora of options.
For this project, I went with cssMenus (a variant of the infamous and totally awesome Suckerfish menus). My main criteria for choosing the menu implementation were:
- CSS based
- SEO friendly
- Supports for nested menus at least 4 levels deep
- Easy to understand and implement
2. Integrate cssMenus into Shopify
This is straight-forward. First, upload the CSS and Javascript files to your theme (Admin > Assets > Theme Assets).
Now, add the following liquid code in the head section of theme.liquid:
{{ 'nav-vr.css' | asset_url | stylesheet_tag }}
{{ 'nav-vr.js' | asset_url | script_tag }}
Finally, set up your menu structure using standard <ul> and <li> HTML tags in collection.liquid. Here is an excerpt :
<ul id="navmenu-v">
<li><a href="/collections/all">ALL PRODUCTS</a></li>
<li><a href="/collections/dexterity">DEXTERITY</a>
<ul>
<li><a href="/collections/dexterity-usa">USA</a>
<ul>
<li><a href="/collections/dexterity-usa-colmor">Colmor</a></li>
<li><a href="/collections/dexterity-usa-gilbert">Gilbert</a></li>
</ul>
</li>
</ul>
</li>
</ul>
I placed this code inside the "collection-desc" <div>.
3. Creating Collections for each menu item
You will notice in the excerpt above that each menu item is associated with a collection.
I created collections for parent items as well, so that users can click on "USA" to see products across the child menus "Colmor" and "Gilbert". The naming convention I used means the names can be used as a breadcrumb.
The final step is to associate each product with the relevant collections. You do this on the product page - just check off the appropriate collections (listed on the right hand side of the page).
Summing up
Creating this navigation system for Shopify took about 2 hours. A lot of that time was spent coding up the list of menu items as there were a lot! For more information or help with this technique, please feel free to contact at Shopify Concierge.
Posted by: TC | 2009.02.04 at 09:04 PM
Posted by: Enrique | 2010.03.28 at 10:42 AM
Posted by: BBG | 2010.03.28 at 10:07 PM
Posted by: Tatiana | 2010.05.17 at 01:01 PM
Posted by: Gavin | 2010.05.17 at 05:11 PM
Posted by: Teddy | 2010.08.24 at 01:08 PM
Posted by: Gavin | 2010.08.24 at 04:33 PM