Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
rlevitz

Linking a folder to a different page?

Question

Site URL: http://levitzmattress.com

Hey everyone,

I'm trying to get the folder name of my nav bar to link to other page.

I know, I know, use <a href>. I did (I used this page for the how-to), and it worked great for a long time. Suddenly it stopped doing anything. It's like the code isn't there.

If someone wouldn't mind, could you go to my site (levitzmattress.com). The "Mattress" nav button should take you to /mattresses-3, which is a guide to help get you to the right mattress. What is actually happening is that it taking you to /mattresses-1 which is just the main product page. What makes things even more complicated, is that its taking you to /mattresses-1 and only showing the Tempurpedic category, instead of all of them.

Similar issues are happening with the Foundations and Accessories nav buttons. How can I fix this?

If you go directly to http://levitzmattress.com/mattresses-1 it does the same thing; only shows you Tempurpedic.  I have links in certain marketing assets that take users to this page. I want it to automatically show All categories upon arriving here. How can that be done?

Any and all help would be greatly appreciated. 

Thanks!

PS This is the Hyde template. 

settings-foundations.png

settings-mattresses.png

settings-access.png

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 1

Add to Home > Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('.Header-nav-folder-title[href="/mattresses-1"]').attr('href','/mattresses-3');
});
</script>

 


You can send your question to my email to get faster answer. I provide free priority support in this crazy time. 

Forum: I usually answer questions at 2pm - 5pm EST

How to Setup Password & Share URL - Squarespace Free Templates - Free Code - CSS ID List

Share this post


Link to post
  • 1
8 hours ago, rlevitz said:

That partially fixes it. I have added that code, and you can see that the first time you click it, it will go to the correct page. If you then click the logo to go back to the home, the nav folder link will take you back to the incorrect page. 

Try disabling Ajax Loading https://support.squarespace.com/hc/en-us/articles/115000253288-Ajax-loading


You can send your question to my email to get faster answer. I provide free priority support in this crazy time. 

Forum: I usually answer questions at 2pm - 5pm EST

How to Setup Password & Share URL - Squarespace Free Templates - Free Code - CSS ID List

Share this post


Link to post
  • 0
On 3/27/2020 at 8:53 PM, tuanphan said:

Add to Home > Settings > Advanced > Code Injection > Footer


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('.Header-nav-folder-title[href="/mattresses-1"]').attr('href','/mattresses-3');
});
</script>

 

That partially fixes it. I have added that code, and you can see that the first time you click it, it will go to the correct page. If you then click the logo to go back to the home, the nav folder link will take you back to the incorrect page. 

Share this post


Link to post
  • 0

That worked! I tweaked that script so it works on all of my nav folders. Any ideas as to why the href in the folder suddenly stopped working?

Share this post


Link to post
  • 0
Posted (edited)

Nav folders by default can have their own url slug just like a page so you can get to the first link in the folder without having to go thru the site menu. 

like mine

https://myrandomviews.com/lessons 

the link is disabled on the nav bar so a viewer doesn't  accidentally chose  it and go back to the first link in the folder when they meant to go to one of the other ones. 

Edited by derricksrandomviews

Share this post


Link to post
  • 0

@tuanphan Great solution - and works well for Squarespace 7 - as at April 2020. Several other solutions to similar questions no longer work.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...