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

Making a folder clickable in Squarespace 7.1


Recommended Posts

@Adam9

I have updated my previous code post. 

When you add the first script to Settings > Advanced > Code Injection > HEADER be very careful installing it. I suggest getting your insertion point at the very beginning of the field. Add a couple of lines. Then get the insertion point back to the beginning of the field and then paste in the script.

2000961652_ScreenShot2021-02-18at6_03_29PM.png.c1cecc58099b672d6fda349b5e25fad8.png

Then for the second script that goes in Settings > Advanced > Code Injection > FOOTER just copy and paste like you did the last time.If something goes wrong with the pasting cancel and start over. 

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment

Hi @creedon

So strange, it still isn't working... it appears to still link to the first page in the folder (if you right-click on Community it opens up Laid Bare Sessions, which is the first link in the list). 

Here's the Header Code:

636280408_Screenshot2021-02-19at12_56_52.thumb.png.29061b4be8eabc7430b1bd17badf3a69.png

And the Footer code:

 

1705420046_Screenshot2021-02-19at12_58_48.thumb.png.42fb2ba59c7e662e6f5453d744fd620b.png1199766064_Screenshot2021-02-19at12_59_13.thumb.png.32eea9f5879a706c9c2bcff565fc6905.png1794522501_Screenshot2021-02-19at13_00_01.thumb.png.6cba16835995898fe862ea0344ec9078.png

Link to comment
  • 2 weeks later...

@LinneaN

Please post the URL for your site.

If your site is not public please set up a site-wide password, if you've not already done so.

Post the password here.

Adding a site-wide password is not a security breach. Please read the documentation at the link provided to understand how it works.

We can then take a look at your issue.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment

@LinneaN

Add the following to Settings > Advanced > Code Injection > FOOTER.

<script>

  $( ( ) => {
  
    /*
    
      begin make navigation folders clickable
      
      SS Version : 7.0
      Template   : Marquee template family
      
      */
      
      const folderNavigationTitleUrlMappings = {
      
        /*
        
          the format of each line is the folder page Navigation Title and the
          URL for the folder
          
          for each folder page copy value from Folder Settings > General >
          NAVIGATION TITLE field. you only need exactly what can be selected
          from the field
          
          */
          
        // '[enter folder page navigation title here]' : '[enter url here]',
        
        'Our Work' : '/our-work-2',
        'Knowledge' : '/knowledge',
        'Languages' : '/arctic-languages',
        'Youth' : '/youth',
        
        // last or only item doesn't get a comma at end of line
        
        'Arctic Leaders\' Summit' : '/arcticleaderssummit'
        
        }
        
      // do not change anything below, there be the borg here
      
      $( '.main-nav .folder-parent > a' ).each ( function ( ) {
      
        let $this = $( this );
        
        const folderNavigationTitle = $this.text ( );
        
        const url = folderNavigationTitleUrlMappings [ folderNavigationTitle ];
        
        if ( url == undefined ) return true;
        
        $this.attr ( 'href', url );
        
        } );
        
      // end make navigation folders clickable
      
    } );
    
  </script>

This is for a v7.0 site using the Marquee template family.

Let us know how it goes.
 

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment

Hi Creedon... I'm also having trouble with this, and would love some help with some code! My site is www.nicolamoorestudio.com - I would like the SHOP menu item to be clickable and default to the 'ALL' folder item... Thank you thank you thank you!

 

Link to comment
  • 4 weeks later...

Thanks to the people who have posted code here. I've tried a couple of ways (including Creedon's) and it works well on desktop but not on mobile. Is there a way to make it work on mobile as well?

Site: https://grapefruit-guava-yyc4.squarespace.com/

PW: FHN2021

I'm referring to the Get Involved folder. Clicks to the Get Involved page on desktop, but not mobile.

Link to comment

@GemGem

That wouldn't work on mobile. The folder for mobile is already clickable. It is how you dive deeper into that folder.

If we were to change the url for Get Involved folder there would be no way to dive into the folder.

An alternative interface would be needed to kind of replicate the desktop functionality. I don't know what that would be. But if you come up with an idea I suggest asking a new question. Although related to this one it's a bit more involved and specific to mobile.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment
  • 2 weeks later...

Using @creedon's code from 2/12, I'm seeing the folders being properly mapped to the correct page URL Slug, but clicking on the folders in the header does nothing. What am I doing wrong?

Page URL: radiusms.squarespace.com

Site Password: 123123

P.S. I'm not sure that I like 7.1. Seems like 7.0 was much more user friendly for those of us that are tech-saavy.

Edited by RadiusMS
Link to comment

@RadiusMS

You did nothing wrong.

It appears that SS has changed the underlying code for folder menus.

Give me several days to see if I can update the code to work again.

If I don't respond in that time frame with a yeah or nay on if the code will work again please bump this thread.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment
1 hour ago, JuleeBode said:

@creedon, are you telling me that I can't have the folder navigation name clickable to a page, it will just open a new menu for the folder?

 

Can you share your site url?

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...