Page 1 of 1

Targeting an id on the same page is not working [solved]

Posted: Wed Nov 12, 2014 12:56 pm
by babel
I have http://shb.nodale.nl/producten were if you click on "toonzaal" for example, you go to the gallery of "toonzaal". I've tried {$smarty.server.REQUEST_URI}#toonzaal. This worked for an other site, but unfortunatly not for this one.
Why is it so difficult to target an id within the same page? Am I missing something?

Re: Targeting an id on the same page is not working

Posted: Wed Nov 12, 2014 2:39 pm
by staartmees
An ID is unique, you can't use it more than one time on the same page.you have you to use class instead.
http://www.w3.org/TR/1999/REC-html401-1 ... ml#h-7.5.2

Re: Targeting an id on the same page is not working

Posted: Wed Nov 12, 2014 3:01 pm
by HarmO

Code: Select all

{cms_selflink page="$page_alias" anchorlink='toonzaal'}
should normally do the trick.

But unfortunately i cant see any anchor name "toonzaal" in your example.

Re: Targeting an id on the same page is not working

Posted: Wed Nov 12, 2014 4:18 pm
by babel
HarmO, thanks for the reply. Unfortunately it's not the solution. It changes the link-name to producten, being the name of the page.

Re: Targeting an id on the same page is not working

Posted: Wed Nov 12, 2014 4:31 pm
by Jo Morg

Re: Targeting an id on the same page is not working

Posted: Wed Nov 12, 2014 5:54 pm
by babel
Jo Morg, I tried that. With jquery works fine. So I'll use that, untill there is a solution for my signaled problem.
Thanks anyway.

Re: Targeting an id on the same page is not working

Posted: Wed Nov 12, 2014 6:11 pm
by babel
It's working now. Why, I don't know. All authors, thanks.

Re: Targeting an id on the same page is not working

Posted: Fri Nov 14, 2014 1:55 pm
by HarmO
you could use this:

Code: Select all

<a href="{cms_selflink href="$page_alias" anchorlink='toonzaal'}>Your text here</a>
href wil only get you the URL where Page wil get you the whole <a>-tag.

Re: Targeting an id on the same page is not working

Posted: Fri Nov 14, 2014 5:16 pm
by Rolf
Without quotes:

Code: Select all

{cms_selflink href=$page_alias anchorlink='toonzaal'}