-
AuthorPosts
-
August 7, 2009 at 7:43 pm #143316
Hi
Not sure how to explain this, but want I want to do is to insert the word TOP in a small font in the
footer, so when someone needs to go back to the top of the page, they don’t have to scroll they just hit the word top and that link does it automatically if this makes sense. Any ideas pleaseRegards
cjmicro Friendcjmicro
- Join date:
- June 2008
- Posts:
- 501
- Downloads:
- 3
- Uploads:
- 0
- Thanks:
- 198
- Thanked:
- 81 times in 10 posts
August 7, 2009 at 11:28 pm #313625you could add an anchor in the html of the template.
templates/yourtemplate/index.php
somewhere after the </head>
<a name=”top”></a>then somewhere at bottom by footer where you want it
<a href=”#top”>Top</a>There is probably some javascript too, but this should work.
Cheryl
August 8, 2009 at 10:08 am #313642Hi
Thank you very much for your reply regarding this issue, couple more questions unfortunately as I new and learning as I go. Is it okay to insert this code at the head directly under <head> and
secondly to insert the second part of the code between the two lines </div> and !–END: CONTENT– > as I think the text TOP is better suited at the bottom of the content and not in the footer. Am I also right in assuming that adding this code will allow me to add the text top to all pages of my site if I what’d to.Regards
cjmicro Friendcjmicro
- Join date:
- June 2008
- Posts:
- 501
- Downloads:
- 3
- Uploads:
- 0
- Thanks:
- 198
- Thanked:
- 81 times in 10 posts
August 9, 2009 at 5:50 pm #313693<blockquote>Is it okay to insert this code at the head directly under <head></blockquote>
AFTER the </head> as you do not want it in the head tags, just in the header part of the website, so somewhere by ja-header div.
[QUOTE[secondly to insert the second part of the code between the two lines </div> and !–END: CONTENT– > as I think the text TOP is better suited at the bottom of the content and not in the footer. Am I also right in assuming that adding this code will allow me to add the text top to all pages of my site if I what’d to.</blockquote>
Yes, you can put the second part whereever you want the “top” to show up, and it will show up on all your pages.
Hope this works!
Cheryl
August 10, 2009 at 8:58 am #313708Hi
Thank you very much for your post on my couple questions, I have inserted the code and it works very well but the only issue is the in the page url in the browser. Once I hit top and go to top of page it shows after .html#top if I don’t hit the text top and scroll back to the top of the page my url ends with .html, do you think the added #top will affect my seo friendly url’s ?.Regards
Raycjmicro Friendcjmicro
- Join date:
- June 2008
- Posts:
- 501
- Downloads:
- 3
- Uploads:
- 0
- Thanks:
- 198
- Thanked:
- 81 times in 10 posts
August 10, 2009 at 12:42 pm #313724Sorry Ray, I do not know this, but glad the link worked. Not sure a name works without the # but you could do a google search on page bookmarks or anchors and see if there is another way.
Cheryl
August 10, 2009 at 6:19 pm #313757Hi
Thanks for all your help on this issue,Regards
Rayantoniu1 Friendantoniu1
- Join date:
- July 2006
- Posts:
- 349
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 29
- Thanked:
- 40 times in 1 posts
August 10, 2009 at 6:27 pm #313759Trick might be to use href=”#page, not href=”#top
Hope this helps,
TomAugust 10, 2009 at 7:17 pm #313770Hi Tom
Thanks for your reply I edited the code with page as you suggested, but when I hit the text TOP at the foot of the page I didn’t go to the top of the page as per the original code edit but worth a try.Regards
Rayantoniu1 Friendantoniu1
- Join date:
- July 2006
- Posts:
- 349
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 29
- Thanked:
- 40 times in 1 posts
August 10, 2009 at 8:18 pm #313776Replace this in your index.php
<div id="footer">
<a class="anchor" href="#page"></a>
<jdoc:include type="modules" name="footer" />
<jdoc:include type="modules" name="debug" />
</div>
and this in your css file:
DIV#footer A.anchor
{
position: absolute;
right: 5px;
top: 20px;
width: 30px;
height: 5px;
background: url(../images/anchor.png) no-repeat 0 0;
display: block;
text-decoration: none;
}This should work. 🙂
Cheers,
TomP.S. Of course, edit the code to your needs. I took this from my own website and pasted it here, as it works like a charm. 🙂
August 11, 2009 at 8:24 am #313812Thank you for the new code but can I just check that I insert the the code in the index.php between
<!–begin:footer–> and <!–end:footer–>One more question, can you confirm please that the other code that has to go into the css file, is to be put into the template.css, and where should I place it?
Sorry to ask but I am still learning as I go here and and have almost reached the end of this site so don’t want to put codes in the wrong place!
Regards
Ray -
AuthorPosts
This topic contains 11 replies, has 3 voices, and was last updated by ray59 15 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum