Jump to content

Locked
cyberseed
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Mon May 14, 2007 12:33 pm

Jump to content

Post by cyberseed » Tue Jul 10, 2007 1:05 pm

Hi I need to add a jump to content link and need some help please. I am using Joomla! 1.0.12 Stable. I have added an anchor "content" to my template and then I tried adding a link to it via the topmenu editor in the backend using link to url. This worked fine on the home page but it does not work on subsequent pages as it links to the home page. I then added some code to the template :

Code: Select all

<li><a href="<?php echo getCurrentURL();?>#content" title="Skip to content">Skip to content</a></li>
But this gave me an error:

Code: Select all

Fatal error: Call to undefined function: getcurrenturl() in /home/onnwmbtq/public_html/joomla/templates/js_lightfast/index.php on line 131
Any help, yes please! ???

 
User avatar
janwin
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Aug 25, 2005 8:21 pm
Location: Kiel

Re: Jump to content

Post by janwin » Fri Jul 13, 2007 8:51 am

Hi,
this seems to be a known Joomla "oddity". You can get somehow around it if you build up your anchors/pagelinks this way:

(your anchor)

and

" title="jump to content">jump to content

But: This results in your page being reloaded. Anyhow, you're jumping to your anchor position then.
I have wrapped that into htmlentities() because I need to have the & parameters masked into & to provide valid xhtml strict sourcecode.

Still this puzzles me, because obviously you have a lot of page reloads then. If anyone can come up with a better solution
to mimic the standard anchor content jump links, I'd love to hear that.

Hope this helps.
Greets janwin

cyberseed
Joomla! Apprentice
Joomla! Apprentice
Posts: 46
Joined: Mon May 14, 2007 12:33 pm

Re: Jump to content

Post by cyberseed » Mon Jul 16, 2007 7:48 am

Ta Janwin
Will try this and hope for a solution that does not require a page reload
cheers

 

Locked

Return to “Design and Accessibility - Archived”