How do I use a different navigation for the blog page only? - Debut Theme

Solved
Highlighted
Tourist
7 0 1

Hi,

I have created a new navigation menu for my blog page only. However, when I tried editing the Debut theme to change the navigation menu, it will automatically change it for the entire site. I would like to use a different navigation menu only for the blog.

 

Please help me resolve this issue if anyone has figured it out. I would sincerely appreciate if you could share your knowledge. 

 

Many Thanks,

Esther

0 Likes
Highlighted
Community Moderator
Community Moderator
3272 246 562

Hi @Esther_,

 

Nick here from Shopify. Great question!

 

I looked into this and spoke to our theme support team for you. They mentioned it is something that would need to be looked further into and would be a little out of the scope of a reply in the community here. If you would like I could reach out to you via email directly to have our theme support team take a closer look for you or if you wanted to contact our support team directly about it you can do so from here

 

If you would like me to reach out to you, could you confirm if the best email to catch you on is the one you signed up to the community with if it isn't can you let me know which is the best one? 🙂

 

All the best, Nick

Nick | Community Moderator @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Highlighted
Tourist
7 0 1

Hi @Nick ,

 

If you can help then I'll be extremely happy if you would take the time out to reach out to me. Contacting me on my registered email address is perfect.

I look forward to hearing from you soon. Thank you for your time.

0 Likes
Highlighted
Shopify Partner
1436 194 489

This is completely addressable in a forum post. You'll want to find where your navigation is included in your theme. In my default Debut theme, it's located in the header.liquid file in the sections folder. In header.liquid you can look for an include for the site nav. So ctrl + f for "include" or "site-nav". You'll want to make an if statement around that, like this:

 

          {% if template == "blog" %}
          {% include 'blog-nav' %}
          {% else %}
          {% include 'site-nav' %}
          {% endif %}

Then open up the site-nav.liquid file in the snippets folder. Copy that code and create a new snippet called "blog-nav" and paste the site-nav code into your new "blog-nav". On the second line you will see this:

 

{% for link in linklists[section.settings.main_linklist].links %}

Change that in the brackets to whatever the handle of your linklist is that you created for your blog. Im going to replace it with a dot, because I prefer the way that looks to brackets. Like this:

 

{% for link in linklists.your-navigation-name.links %}

Now when you go your blog you will have a different set of links.

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
1 Like
Highlighted
Tourist
7 0 1

Hi @Ninthony ,

Thank you for your help. I just tried to resolve it with your code. I followed it step by step and had no effect on the blog page as it still is using the main nav.

0 Likes
Highlighted
Shopify Partner
1436 194 489

Can you post a link to your store and a password if it's password protected?

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
Tourist
7 0 1

@Ninthony  my website is https://creativ-ocean.myshopify.com

and the passwords is poopla

0 Likes
Highlighted
Shopify Partner
1436 194 489

okay I just wanted to be sure you were on a blog template. I'd probably need to take a look at your files to be sure what's going on. I sent a request to access parts of your site from my developer store. If you accept the request I can take a look to see what's going on.

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
Tourist
7 0 1

@Ninthony Thank you, I've granted you access now.

0 Likes
Highlighted
Shopify Partner
1436 194 489

This is an accepted solution.

Alright I fixed it. You didn't do the if statement in the header.liquid and also there were a couple typos in your 

{% for link in linklist[blog]links %}

Should have been:

 

{% for link in linklists.blog.links %}

 Working now

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes