Archived topic
Anchors Broken
3 replies · Started by Warren on February 10, 2022
Hi there,
I've added containers, given them their ids (container > advanced > HTML Anchor). I've used both button and plain text to create the link (#link1), published and refreshed. When clicking on the text or button, nothing happens.
In List View, the selected container shows the anchor name next to it, and when viewing the page source, I can see the "div-id="link1".
Why does this appear broken?
Hi Warren,
Can you link us to the page w/ the issue? So we can check for clues as to why the issue happens.
If you wish to keep the link private, you can use the private information text field -
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Let us know. :)
Sure, attaching below.
Note: The text link "ask our existing" and "reasons" in the opening paragraph work fine. The text link "how can we help" and button "I'd like a quote" that should link to "how can we help" section does not work.
Ah I see the issue here:
This specific page has 2 layouts that have the same IDs.
IDs should be unique for the anchor to work. It wasn't working on this page because you have elements that have id="howcanwehelp".
One is a button hidden on desktop, another is a container block, which I believe is the actual intended target of the link.
Try removing the howcanwehelp id for this button. https://share.getcloudapp.com/2NuvoGZn