How do you insert code for an anchor link on the product page to another section on same page?
Hi @Rob4836 ,
You can provide the ID of the section as the value of the href with a hash tag.
Code should show like below.
Find the shopify tempalte ID being used
then when you insert a link for the button
use and insert where you want it to go
#shopifytempalte-xyz-xyz
Hello! I have the same issue. Could you please advise on how to find the section ID please? thank you!
NVM found it
Hi there!
I’ve been trying to follow the steps you mentioned to link a specific section on my About us page but it doesn’t seem to work. Whenever I click on the submenu item it says page not found. I’m not sure what I’m doing wrong. Any ideas?
My store is here
Hi @FlorenciaDoy ,
You are missing the word pages. See correct link below
https://boggybayoumeats.com/pages/about/#shopify-section-template--16095063539953__1654538660f91a9f9f
Silly me! Thanks a ton
Just one more question. I noticed that whenever I add a submenu, the top menu items stop working. They don’t link to the correct page anymore. Is there a way to fix that?
Are you talking about the About word? The parent link is suppose to just open the child link, that is the desired function. If you let the parent link navigate then you will not be able to click the child link.
Ok, I see. Thanks for your help!
The solution provided only works if you use the standard text area provided in the standard page template, however if you are using any other page widget (banners, text etc) to build your page then this will not work as none of these widgets allow you to insert/edit HTML.
If, like me, you’re using widgets to populate your pages then you will need to do the following:
-
Activate your browser code inspector (usually right click on the target link area and select “inpsect”.
-
In the HTML find the section ID for that widget, it’ll be something like <section ID=“shopify12345555etc”
-
Copy the section ID, that is the anchor you will use to link to
-
Add your button somewhere else, and insert # followed by the section ID e.g. #shopify123456etc
-
Make sure you hit ENTER
-
Publish page.