Back to top not working

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Oct 06, 2015 1:14 pm
Reply with quote
Report this post
Hi: a little problem. The back to top link in a k2 item, doesn't goes to top.
I try this from a clean installation of gk_news_quickstart_J!3.zip

http://www.club-pescadores.com.ar/subdo ... he-nation#
User avatar
Senior Boarder

GK User
Thu Oct 08, 2015 8:00 am
Reply with quote
Report this post
Hi, it doesn't work, because be default is linked to article title, which is not link in your case anymore.
So I suggest to hide this "up" button

.itemBackToTop {display:none;}
User avatar
Platinum Boarder

GK User
Thu Oct 08, 2015 11:25 am
Reply with quote
Report this post
Sorry: I d'ont understand ... in my case i'm using k2 ... back to top is only for joomla native articles ?

Thanks !
User avatar
Senior Boarder

GK User
Thu Oct 08, 2015 2:07 pm
Reply with quote
Report this post
back link is generated by K2 items, and looks that it not working well.
This may be a K2 issue.
--
In theory I can fix, but it will be based on php file edition.
User avatar
Platinum Boarder

GK User
Thu Oct 08, 2015 2:10 pm
Reply with quote
Report this post
Thinking the same ... modifying:
html\com_k2\templates\templates\default\item.php with a javascript call. I'll make some research... thanks !
User avatar
Senior Boarder

GK User
Thu Oct 08, 2015 2:51 pm
Reply with quote
Report this post
Easy way,
just replace dynamic link with static taken from header ID section, this same effect.
User avatar
Platinum Boarder

GK User
Thu Oct 08, 2015 3:14 pm
Reply with quote
Report this post
In this line al item.php ?
<a class="itemBackToTop" href="<?php echo $this->item->link; ?>#"> <?php echo JText::_('K2_BACK_TO_TOP'); ?> </a>
User avatar
Senior Boarder

GK User
Thu Oct 08, 2015 6:52 pm
Reply with quote
Report this post
I guess, it should be it.
User avatar
Platinum Boarder

GK User
Fri Oct 09, 2015 2:56 pm
Reply with quote
Report this post
Hi: i make some changes... seems to be working ok and anything is broken. If you take a look and it's ok, perhaps this are my two cents ;)

Regards,
Leandro

Test link: http://www.club-pescadores.com.ar/insti ... storiaclub

_________________
Two changes:

1) In mytemplate\html\com_k2\templates\default\item.php

Line:
<a class="itemBackToTop" href="<?php echo $this->item->link; ?>#"> <?php echo JText::_('K2_BACK_TO_TOP'); ?> </a>

Change:
<a class="itemBackToTop irArriba" href="<?php echo $this->item->link; ?>#"> <?php echo JText::_('K2_BACK_TO_TOP'); ?> </a>


2) In mytemplate\layouts\default.php

In the next script, add the bolded line:

<script>
jQuery(document).ready(function(){
// Target your .container, .wrapper, .post, etc.
jQuery("body").fitVids();

jQuery(".irArriba").click(function() {
window.scrollTo(0,0);

});
});
</script>
User avatar
Senior Boarder

GK User
Sat Oct 10, 2015 12:37 am
Reply with quote
Report this post
Try only this small change:
<a class="itemBackToTop" href="#gkPageTop"> <?php echo JText::_('K2_BACK_TO_TOP'); ?> </a>
User avatar
Platinum Boarder

GK User
Sat Oct 10, 2015 1:14 pm
Reply with quote
Report this post
Thanks ! Yours is a better solution.
User avatar
Senior Boarder


cron