-
- 1 Posts
Hello everyone.
Im new to MODx and have stumbled on a problem.
Im trying to link to an ID within a page, but due to the <base href="[(site_url)]" /> it sends me to my index page.
eg. mydomain.xxx/#top instead of the page im on and then #top
Is there a snippet out there that can help?
Or has anyone had this problem before and solved it.
Appreciate the help, many thanx.
-
- 3,250 Posts
Try this for the href of your a tag:
[(site_url)][~[*id*]~]#top
-
- 1 Posts
Ive already tried that, thanx.
The tag needs to be in the template, therefore this method sadly doesnt work.
Is there no snippet out there?
Here in this forum is a link "Go Up", what I need is similiar
-
- 788 Posts
heres a little snippet I use:
[[toplink]]
/* toplink
produces a link back to the top of the page
*/
$toplink = $modx->makeUrl($modx->documentIdentifier);
$toplink .="#top";
$output ="<div align='right'><a href='$toplink' class='toplink' title='Jump to the top of the page'>Back to Top <img src='assets/templates/default/images/backtotop.gif' border='0' alt='Jump to the top of the page' /></a></div>";
return $output;
change the last $output to format the link the way you want...
-
- 1 Posts
@Breezer, thats excellent, thanx for your help.
Much appreciated