Jump to content

lahero

Member
  • Posts

    2
  • Joined

  • Last visited

Posts posted by lahero

  1. On 6/18/2020 at 6:18 PM, snorkelcookislands said:

    @lahero Hey thanks for that, but it didn't work...

    This is what I injected into the Code Injection Footer

    <script>
      (function()
      {window.addEventListener("load", function () {
        var tours = document.querySelector('[href="/book-a-tour"]');
        tours.addEventListener("click", function () {
          window.location = "https://snorkelcookislands.com/book-a-tour";
        });
      })}
      )();
    </script>

    Have I written something wrong here? Because the parent header "Tours" just links to the first link "Reef Snorkelling"

    @RyanDejaegher Maybe you can help? 🙃

     

    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. 

  2. 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).

     

    1. Get the slug you assigned to your folder (e.g. "/folder")
    2. 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.

×
×
  • 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.