What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Change Menu Based On Criteria

Solved

How can I modify a menu based on page tags in the Refresh Theme?

DXTodd
Shopify Partner
6 1 0

I am trying to change a menu based on page tags on the Refresh Theme.

 

I am working in the Header.liquid and after trying three different ways I figured I am stuck so I will pose the question here.

 

Site: https://goldmedalwine.myshopify.com/

Password:3m3rt%3

 

Here is code change trying to just force all to one menu before I rewrap it in a if{% assign menu = 'wsmenu' %}
{% assign section.settings.menu= 'wsmenu'%}
Menu: {{ section.settings.menu }}
{% assign menu_handle = 'wsmenu' %}

 

This is just above the Nav div and I have tried it below and when it displays it is always the main menu

 

Here is the code from the header at line 395
{%- if section.settings.menu != blank -%}
{%- if section.settings.menu_type_desktop == 'dropdown' -%}
<nav class="header__inline-menu">
<ul class="list-menu list-menu--inline" role="list">
{%- for link in section.settings.menu.links -%}
<li>
{%- if link.links != blank -%}
<header-menu>

 

So all in all any help or directions would be awesome

Accepted Solution (1)
DXTodd
Shopify Partner
6 1 0

This is an accepted solution.

Again thank you.

 

It was your snide message that allowed me to see the issue.

I needed to set the menu item to the proper section 

assign menu_item = section.settings.menu
Then my if then , then assign the linked list.
assign menu_item = linklists.wsmenu
Thank the creator for docuentation 

View solution in original post

Replies 3 (3)

Simonsron
Shopify Partner
699 87 122

You're doing the wrong thing by customising section.settings.xxx!

 

Because the content of section.settings.xxx is defined primarily through the backend, not by you assigning values to it in code!

banned
DXTodd
Shopify Partner
6 1 0

Thank you for your most supportive and informative missive.

 

DXTodd
Shopify Partner
6 1 0

This is an accepted solution.

Again thank you.

 

It was your snide message that allowed me to see the issue.

I needed to set the menu item to the proper section 

assign menu_item = section.settings.menu
Then my if then , then assign the linked list.
assign menu_item = linklists.wsmenu
Thank the creator for docuentation