New shopify user here! I am trying to add links in my main menu navigation that go to particular locations on my home page (anchor links). I've found a few threads that discuss this generally but I can't figure out where to add the anchor link HTML to the narrative theme.
I tried using a custom html section, but I am unable to access that custom html section from the "add item to main menu" area:
I think you need a menu item for a section within a page. Please check the following links that will help you to make it possible.
hope this helps.
Thanks for the reply dmwwebartisan! I did see those links, but they don't specify how to add the html required for the anchor link. I wanted to confirm if the way I was doing it (with a custom HTML block) was the right way.
And also, even though I can add a an anchor link, how do I add that link to the main menu?
Custom HTML is fine but in custom HTML you can use the code like the following not Anchor link
<div id="sectionid">New section</div>
After that in navigation, you can use anchor like following
That should work. Hope you understand.
Ok so I got the anchor link in, and it works from the menu (/#ourteam) if I am navigating from any page other than the home page.
Here's the custom HTML block: <h2 style="color:#242424;)"><center><a name="ourteam">Our Team</a></center></h2>
However, clicking on it doesn't work if I'm already on the home page. So if I was using the menu to navigate around the home page it wouldn't work. Any thoughts on how to address this? Thanks!