Jump to content

Header anchor links to work on other pages

Recommended Posts

Site URL: https://www.pozeband.com/boutique/p/t-shirt-noir-unisexe-grand-logo-smlxl

Hi,

I have set anchor links in my header which can glide down to sections of my home page with code blocks.

When I'm on another page, like a product page (which is the site URL I have linked), if I click on my anchor links in my header, which just contain, for example "#biographie" or "#contact", it just stays on the product page because it's not mentionning my website's name, like so: "pozeband.com/#biographie"

So, I have added my full website URL + the anchor to my header links, such as "pozeband.com/#biographie" and "pozeband.com/#contact".

My issue is that, now, when I'm on my home page and that I click on my header links, it reloads the full page before gliding down to the anchors.

Is it possible to have my header anchor links be "#biographie", "#contact" when I'm on my home page
AND
have my header anchor links be "pozeband.com/#biographie", "pozeband.com/#contact" on all other pages?
(or any another way to make it work as intended)

Thanks!

EDIT: #biographie and #contact in my examples are anchors which are on my homepage

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

7 hours ago, pozeband said:

Site URL: https://www.pozeband.com/boutique/p/t-shirt-noir-unisexe-grand-logo-smlxl

Hi,

I have set anchor links in my header which can glide down to sections of my home page with code blocks.

When I'm on another page, like a product page (which is the site URL I have linked), if I click on my anchor links in my header, which just contain, for example "#biographie" or "#contact", it just stays on the product page because it's not mentionning my website's name, like so: "pozeband.com/#biographie"

So, I have added my full website URL + the anchor to my header links, such as "pozeband.com/#biographie" and "pozeband.com/#contact".

My issue is that, now, when I'm on my home page and that I click on my header links, it reloads the full page before gliding down to the anchors.

Is it possible to have my header anchor links be "#biographie", "#contact" when I'm on my home page
AND
have my header anchor links be "pozeband.com/#biographie", "pozeband.com/#contact" on all other pages?
(or any another way to make it work as intended)

Thanks!

EDIT: #biographie and #contact in my examples are anchors which are on my homepage

I have one solution for your issue. With the header nav anchor link, we will create 2  link pages:

- One link for anchor link on Home Page, we set it's link with #yourtargetid

- One link for anchor link on other Site, we apply it's link with /#yourtargetid

We can use some pure Css code to hide/display the suitable header.

Hope that it makes sense

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

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

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.