PDA

View Full Version : Template var for the page?


MTGDarkness
06-02-2009, 08:13 PM
Basically, I want to add a button that aims for the top of the page on each post. But I can't figure out how to make it work with threads and stuff... Basically, I have it as <a href="#top">, but I know I need something before the top... what do I need?

Lynne
06-02-2009, 09:13 PM
The link is on the bottom of every page. Just steal the code from it (I believe it's in the footer).

MTGDarkness
06-02-2009, 09:17 PM
I know the top link in the footer, but that also only ever leads to forum home. I need it to link to the top of the current page.

Lynne
06-02-2009, 09:54 PM
Well, you need to add an anchor to where you want the link to take you.
Anchor:
<a name="yourname">whatever</a> Link:
<a href="#yourname">To the Top!</a>

Seven Skins
06-02-2009, 09:56 PM
Add this to the bottom of navbar template:
<a name="top2">&nbsp;</a>

Add this to where ever you want:
<a href="#top2">Top</a>

And it should scroll you to top of page just below navbar.



--------------- Added 1243983418 at 1243983418 ---------------



Opps too late :p ... already poasted by Lynne

Lynne
06-02-2009, 09:57 PM
Beat you by two minutes, Seven Skins! :D

MTGDarkness
06-02-2009, 10:03 PM
Yes, but that would link to that anchor on the forumhome, not on the showthread template.

Seven Skins
06-02-2009, 10:05 PM
True ... I was testing the code before posting ... so I know for sure if it works or not.

--------------- Added 1243984077 at 1243984077 ---------------

Yes, but that would link to that anchor on the forumhome, not on the showthread template.

We are anchoring that just below navbar ... so the page scrolls upto navbar only.
I have tested it and it works on all pages ... forumhome, showthread, userCP ...