lahero
-
Posts
2 -
Joined
-
Last visited
Content Type
Forums
Gallery
Blogs
Events
Store
Downloads
Profiles
Posts posted by lahero
-
-
On 6/16/2020 at 6:58 PM, snorkelcookislands said:
Thank you @RyanDejaegher How can input the page I would like the header to be linked to?
I would like it to be linked to this page https://www.snorkelcookislands.com/book-a-tour-bokun-products
@snorkelcookislands - just do the following steps (the script is taken from @RyanDejaegher).
- Get the slug you assigned to your folder (e.g. "/folder")
- Add the following script to how @RyanDejaegher mentioned: Settings -> Advanced -> Code Injection -> Footer
<script> (function() {window.addEventListener("load", function () { var tours = document.querySelector('[href="FOLDER SLUG COPIED FROM STEP 1"]'); tours.addEventListener("click", function () { window.location = "PAGE SLUG OR FULL URL"; }); })} )(); </script>
3. Replace "FOLDER SLUG COPIED FROM STEP 1" with your slug copied from step 1 🙂 Make sure you leave the double quotes there.
4. Replace "PAGE SLUG OR FULL URL" with whatever page slug you want! Make sure you leave the double quotes there.
This solution worked for me! Thanks @RyanDejaegher for the inspiration.
- RyanDejaegher and doverkohl
- 1
- 1
Squarespace 7.1 - Linking navigation folder to first item in the folder
in Customize with code
Posted · Edited by lahero
Hey @snorkelcookislands - your code doesn't make sense just yet. You are selecting the link `/book-a-tour` and telling it to go to a page called `.../book-a-tour` - just going in circles 🙂. What you need to do is take the slug from the folder and direct it to go to a different page. Once you sort out that difference, you should be good to go. I've updated my original answer to hopefully make this more clear.