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

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

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

Post 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?
Last edited by babel on Mon Dec 01, 2014 1:29 pm, edited 1 time in total.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

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

Post 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
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

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

Post 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.
Kind regards,
HarmO
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

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

Post 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.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1968
Joined: Mon Jan 29, 2007 4:47 pm

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

Post by Jo Morg »

"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

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

Post 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.
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

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

Post by babel »

It's working now. Why, I don't know. All authors, thanks.
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

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

Post 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.
Last edited by HarmO on Sat Nov 15, 2014 1:27 pm, edited 1 time in total.
Kind regards,
HarmO
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

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

Post by Rolf »

Without quotes:

Code: Select all

{cms_selflink href=$page_alias anchorlink='toonzaal'}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Layout and Design (CSS & HTML)”