Products Menu

Add a clearly defined "Products" link menu, which, when hovered over, shows categories and sub-categories, providing users with a simple way to find your products.

Wireframe


Preparation Checklist

Before you start this tweak, it's a good idea to run through our preparation checklist below:

  • Read through the Getting Started to get a better sense of how the control panel, Database and Front End store interact.
  • Learn our recommended Simple Workflow. This makes the implementation process as easy as possible.
  • Create a new Staging Theme for this tweak. This allows you to preview any changes before they are visible to live customers.
  • The code snippet in this tweak doc uses Bootstrap 3, you may need to alter this code depending on what version of Bootstrap your theme is using. You can find out what version your theme is using here.

Coding Instructions

Step 1: Open the header template

Navigate to the header template /httpdocs/assets/themes/[THEME-NAME]/templates/headers/template.html.

Step 2: Add the code into the template

Paste the following code directly after [%menu id:'web_header'%]:

[%param *header%]
    [%CACHE type:'cmenu' id:'catmenu_header'%]
    [%content_menu content_type:'category' sortby:'sortorder,name' show_empty:'1'%]
        [%PARAM header%]
        <li class="dropdown dropdown-hover"><a href="/products" class="dropdown-toggle">Products <span class="caret"></span></a>
            <ul class="dropdown-menu">
                [%/PARAM%]
                [%PARAM *level_1%]
                    <li class="[%DATA id:'next_level' if:'ne' value:''%]dropdown dropdown-hover[%/DATA%]"><a href="[@url@]" class="dropdown-toggle">[@name@]</a>
                        [%DATA id:'next_level' if:'ne' value:''%]
                            <ul class="dropdown-menu dropdown-menu-horizontal">
                                [@next_level@]
                            </ul>
                        [%/DATA%]
                    </li>
                [%/PARAM%]
                [%PARAM *level_2%]
                    <li class="[%DATA id:'next_level' if:'ne' value:''%]dropdown dropdown-hover[%/DATA%]">
                        <a href="[@url@]">[@name@]</a>
                        [%DATA id:'next_level' if:'ne' value:''%]
                            <ul class="dropdown-menu dropdown-menu-horizontal">
                                [@next_level@]
                            </ul>
                        [%/DATA%]
                    </li>
                [%/PARAM%]
                [%PARAM *level_3%]
                    <li class="lv3-li">
                        <a href="[@url@]">[@name@]</a>
                    </li>
                [%/PARAM%]
                [%PARAM footer%]
            </ul>
        </li>
        [%/PARAM%]
    [%/content_menu%]
    [%/CACHE%]
[%/param%]

Final Result


Was this article useful?

Be notified when this page is updated. Optional.