1. Check the Documentation

2. Make a search

3. Read Support Rules
before posting

  • Index
  • » AceSEF
  • » Hacks, Tricks and Tips
  • » How To Get HTML Anchors Working

How To Get HTML Anchors Working

How To Get HTML Anchors Working

#1 Top

How To Get HTML Anchors Working

My Template has an anchor link on the bottom of each page, the link is anchored to the top of the page.

Code:

It did not work with AceSef because I have the base href tag in my header. Making the link abosolute did not work either, the link on every page returned the user to the top of the homepage.

Code:

I found this solution

Add This Code To the top of the page, in my case, I need this on every page so I added it to the top of my templates index.php file.

Code:

function curPageURL() {

$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>

Then Use This In Your Url

Code:

Example:

Code:

Larry
Non-Customer
useravatar
Offline
28 Posts
User info in posts
Administrator has disabled public posting
#2 Top

Re: How To Get HTML Anchors Working

Thank you Larry for this tip, you can also check this:
http://www.joomace.net/documentation/ac … -resources

If you use AceSEF, please support us by posting a rating and a review at the Joomla Extension Directory

Denis Dulici
Administrator
ranks
useravatar
Online
2029 Posts
User info in posts
Administrator has disabled public posting
#3 Top

Re: How To Get HTML Anchors Working

@ denis
link gives a 404

I made workaround javascript links like this:

Code:

which is ugly, but works. Obviously Larry's solution is much nicer.

Thanks.

http://www.pages-and-items.com

carsten888
Non-Customer
useravatar
Offline
86 Posts
User info in posts
Administrator has disabled public posting
#4 Top

Re: How To Get HTML Anchors Working

Link updated.

If you use AceSEF, please support us by posting a rating and a review at the Joomla Extension Directory

Denis Dulici
Administrator
ranks
useravatar
Online
2029 Posts
User info in posts
Administrator has disabled public posting
#5 Top

Re: How To Get HTML Anchors Working

thanks

http://www.pages-and-items.com

carsten888
Non-Customer
useravatar
Offline
86 Posts
User info in posts
Administrator has disabled public posting
  • Index
  • » AceSEF
  • » Hacks, Tricks and Tips
  • » How To Get HTML Anchors Working