- Posts: 5
COMMUNITY FORUM
Back to Top
- Vagelis Dimeris
-
Topic Author
- Offline
- New Member
Less
More
11 years 3 months ago #124714
by Vagelis Dimeris
Back to Top was created by Vagelis Dimeris
Hi to all
I need to modify the "Back to Top" to goes to top of the page and not to top of the content...
Could you please let know how to achieve this ???
Many Thanks
I need to modify the "Back to Top" to goes to top of the page and not to top of the content...
Could you please let know how to achieve this ???
Many Thanks
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 3 months ago - 11 years 3 months ago #124715
by Lefteris
Replied by Lefteris on topic Re: Back to Top
You can add in your index.php of your template right under the body tag a <span id="topOfPageId<?php echo JRequest::getInt('id'); ?>"></span>
and then in your K2 template override (read here getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates on how overrides work if you don't use already) modify the anchor link located in item.php file to
and then in your K2 template override (read here getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates on how overrides work if you don't use already) modify the anchor link located in item.php file to
<?php if(!JRequest::getCmd('print')): ?>
<div class="itemBackToTop">
<a class="k2Anchor" href="<?php echo $this->item->link; ?>#topOfPageId<?php echo JRequest::getInt('id'); ?>">
<?php echo JText::_('K2_BACK_TO_TOP'); ?>
</a>
</div>
<?php endif; ?>
Please Log in or Create an account to join the conversation.
- Vagelis Dimeris
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 3 months ago #124716
by Vagelis Dimeris
Replied by Vagelis Dimeris on topic Re: Back to Top
Thank You !!!
This is what I need
This is what I need
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
11 years 3 months ago #124717
by Yiota
Replied by Yiota on topic Re: Back to Top
You are welcome.
Please Log in or Create an account to join the conversation.
- Justin Place
-
- Offline
- Senior Member
Less
More
- Posts: 69
11 years 1 month ago #124718
by Justin Place
Replied by Justin Place on topic Re: Back to Top
Thanks very much for this code!
Please Log in or Create an account to join the conversation.