- Index
- » AceSEF
- » Hacks, Tricks and Tips
- » How To Get HTML Anchors Working
How To Get HTML Anchors Working - Forums Task Topic P 1 Id 2865
How To Get HTML Anchors Working - Forums Task Topic P 1 Id 2865
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:
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
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
- Index
- » AceSEF
- » Hacks, Tricks and Tips
- » How To Get HTML Anchors Working
