add link to another block on same page1 user found helpful
1) Create the "anchor" (the spot in the page you want to scroll to when the link is clicked) by adding an HTML block and pasting this code in it:
<a name="my-link-name" />
You will probably want to move that so it's directly above the block that you want to scroll to when the link is clicked.
2) Create the link to the anchor by adding a content block, typing in the link text, highlighting that text and clicking the little "chain link" icon in the toolbar. In the "Link URL" box, enter a hash symbol (#) followed by the name you used for the anchor -- for example:
Hope that helps!
1. Let's say the name of my link will be the word, product.
So, the HTML code will be
<a name="product" />
2. In the link URL box, I insert:
is that right?
thanks very much.
I linked the anchor text "The Story" as follows
Insert this text in an HTML block above the target block:
<a name="the-story" />
Insert this text in the link box: #the-story
The link worked, but unfortunately, it caused all the text in the target block to turn blue and behave as link text.
It did the same to all subsequent blocks as well.
Is there a solution to that?
I am trying this out and it works but it keeps opening in a new tab. Is there any way that I can stay on the same page when a link is clicked?
I am really struggeling with my anchor tags.
I'm trying to make a back to top anchor tag (thats hard coded into the code and not added via edit page).
So I have an image as the button and then it links to the anchor at the top of the page.
When I click the button it simply changes the URL to the same page, but with #backtotop at the end of it.
It doesn't move me to the top of the page at all. I saw someone say that there's a cheat because concrete5 can be buggy with anchor tags, so I tried adding the ./ infront of the # as they recommend, but it gives the same result mentioned above.
(could it be an issue due to the fact that the website is still in the conc subfolder?)
This is my code:
<a href="./#backtotop"><img src="<?=$this->getThemePath()?>/images/back-to-top.jpg" alt="back to top" /></a>
Alternately, you could try doing the anchor as an id on a div instead, like <div id="backtotop"></div> ... and leave the link (<a href="#backtotop">...</a>) the same.
Changing it to a div worked perfectly!