Jump to content

How to Make the Folder Navigation Title to link to a specific page

Recommended Posts

Site URL: https://atanasmalamov.com

Hi guys, 

I have looked on the forum but have not found a solution that works for me. I am using the Haute template. 

I have a folder on my navigation with 4 pages inside. Currently if i click on "Dance with Atanas" it opens the first page in the folder. My goal is upon click on "dance with Atanas" to take you to a specific page not the first page in the folder. Is that possible? Thank you and sorry if solution was listed somewhere

Link to comment
  • Replies 10
  • Views 598
  • Created
  • Last Reply

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>
$(".Header-nav-item--folder:nth-child(4)>a").click(function() {
    var link = $(this).text(),
        href = "https://beaverhero.com";
    window.location.href=href;
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

I tried. It is really strange. It works but only the 1st time you load a page and click on it, it opens the new page. but if you click 2nd time on the folder it opens the other page.

Link to comment
  • 4 weeks later...

I'm having the same issue. I used the one Andrius sent and it seemed to work, but I can't tell since I'm still on the trial and some of the URL requests don't work normally as a live page.

Problem: I can't tell since it's the trial, but I might be getting a two page loads. Here's my folder structure:

Folder
  Link
  Page 1
  Page 2
  ...

Here's what I think is happening:
1. Click on folder and loads first page content. In this case it is a link
2. Makes a second URL request since it's a link
3. Loads desired page.

Again, I can't tell if this is what would happen on a paid version, but I'm inconsistently getting two requests by clicking on the folder link. 

Hack: Couldn't we also set up a redirect from the folder's URL to the desired page/index we want the folder to go to?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.