creedon Posted January 26, 2021 Share Posted January 26, 2021 @ZionLacroix If I understand what you want correctly. It sounds like you do need to use @tuanphan's guide. There are instructions for your site under the v7.1 section of his guide. If you need to discuss adding pages or organizing information I suggest starting a new thread. It is difficult to work on different issues in the same thread. ZionLacroix 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Adam9 Posted February 10, 2021 Share Posted February 10, 2021 Hey @tuanphan For the novices in the room... what do I need to replace in this code to make the Navigation Headers clickable on the below website: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { $('.header-nav-folder-title[href="/services-1"]').click(function() { window.location = "/services"; }); }); </script> https://www.laidbaremusic.com/ I would like COMMUNITY to directly link to: https://www.laidbaremusic.com/community And SERVICES to link directly to: https://www.laidbaremusic.com/services Is this possible with your code above? Thanks in advance. Link to comment
Adam9 Posted February 12, 2021 Share Posted February 12, 2021 On 2/10/2021 at 11:20 PM, Adam9 said: Hey @tuanphan For the novices in the room... what do I need to replace in this code to make the Navigation Headers clickable on the below website: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { $('.header-nav-folder-title[href="/services-1"]').click(function() { window.location = "/services"; }); }); </script> https://www.laidbaremusic.com/ I would like COMMUNITY to directly link to: https://www.laidbaremusic.com/community And SERVICES to link directly to: https://www.laidbaremusic.com/services Is this possible with your code above? Thanks in advance. Or can anyone else help with the above please? Link to comment
creedon Posted February 12, 2021 Share Posted February 12, 2021 (edited) @Adam9 Please see Make Navigation Folders Clickable. This is for v7.1. After the example line in the code add the line as follows. // '[enter folder page url slug here]' : '[enter page url slug here]', 'mhfa' : '/mental-health-first-aid', It accomplishes the same end task that the code you posted does. Let us know how it goes. Edited August 4, 2021 by creedon tuanphan 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Adam9 Posted February 17, 2021 Share Posted February 17, 2021 Hi @creedon, Thanks very much for taking the time to do that. I copied and pasted the above in the Header & Footer, but unfortunately it still hasn't worked. Is there anything I may have missed? Link to comment
creedon Posted February 17, 2021 Share Posted February 17, 2021 (edited) @Adam9 I see a couple of problems. Let's pull that code out for now and let me take another run at it. When you pull out the following replace it with </style> as when you installed it I think you might have accidentally erased that text. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> Also remove the other script from Settings > Advanced > Code Injection > FOOTER. Edited February 17, 2021 by creedon Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
creedon Posted February 17, 2021 Share Posted February 17, 2021 @Adam9 Give me a heads up when you've done that. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Adam9 Posted February 18, 2021 Share Posted February 18, 2021 Hi @creedon, That's done now - thanks! creedon 1 Link to comment
creedon Posted February 19, 2021 Share Posted February 19, 2021 @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. 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 the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Adam9 Posted February 19, 2021 Share Posted February 19, 2021 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: And the Footer code: Link to comment
creedon Posted February 19, 2021 Share Posted February 19, 2021 @Adam9 It isn't working because the jQuery library script has been put into the middle of a style tag. That won't work. Please follow my suggestions in my previous post on how to install the jQuery script so it doesn't get mixed in with other code. Adam9 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Adam9 Posted February 19, 2021 Share Posted February 19, 2021 Thank you@creedon! It seems to be working. Apologies, I misunderstood and missed that the Header code should be right at the top! All fixed, much appreciated 🙏🏽 creedon 1 Link to comment
BGilbertson Posted March 1, 2021 Share Posted March 1, 2021 Hello, I would like my header navigation folders to be clickable and to land on a contents page with a list of pages in that folder. Multiple folders (~5), each with (~3) pages in them. I've read a few things around and the CSS code I have seen to do it seems overly complex. Any thoughts on how to approach this? Kindly, Bryn Link to comment
LinneaN Posted March 2, 2021 Share Posted March 2, 2021 Hi, is this possible to do with version 7.0 and the template Shift? I have tried both methods by @tuanphanand @creedon but neither seem to work. Link to comment
creedon Posted March 2, 2021 Share Posted March 2, 2021 @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 the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
tuanphan Posted March 3, 2021 Share Posted March 3, 2021 Do you have an example/mockup - Also can you share link to your site? 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
LinneaN Posted March 5, 2021 Share Posted March 5, 2021 Hi again, here's the site I am working on: https://www.arcticpeoples.com/ Link to comment
creedon Posted March 5, 2021 Share Posted March 5, 2021 @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. tuanphan 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
LinneaN Posted March 7, 2021 Share Posted March 7, 2021 Thanks so much for the help @creedon, that worked! creedon 1 Link to comment
nicmoore Posted March 11, 2021 Share Posted March 11, 2021 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
creedon Posted March 11, 2021 Share Posted March 11, 2021 @nicmoore If you go back through the posts in this thread and find my Feb. 12th post., the code you need is there. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
creedon Posted April 8, 2021 Share Posted April 8, 2021 I have updated my Feb. 12th code post. If your current code for a v7.1 is working there is no need to update. The main change to the code is the option to not specify any mappings and the code will automatically make the folder link point to the first page in the folder. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
creedon Posted April 15, 2021 Share Posted April 15, 2021 I have updated my Feb. 12th code post. No need to update if your current code is working OK. The change in this version is to deal with a disappearing folder title in some circumstances. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
GemGem Posted April 15, 2021 Share Posted April 15, 2021 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
creedon Posted April 16, 2021 Share Posted April 16, 2021 @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 the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment