Keyword

Back to Top

  • Vagelis Dimeris
  • Vagelis Dimeris's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 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

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago - 10 years 7 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
<?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; ?>

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Vagelis Dimeris
  • Vagelis Dimeris's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #124716 by Vagelis Dimeris
Replied by Vagelis Dimeris on topic Re: Back to Top
Thank You !!!

This is what I need

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 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.

More
10 years 5 months 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.


Powered by Kunena Forum