Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Integration with third-party extensions    K2 JComments    Topic: Latest comment link is loading K2-article on frontpage
Pages: [1]   Go Down
  Print  
Author Topic: Latest comment link is loading K2-article on frontpage  (Read 52147 times)
0 Members and 1 Guest are viewing this topic.
NorShine
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« on: December 05, 2010, 04:28:13 »

I'm using Jcomments together with K2. I've set it all up correctly and it works very nice showing the latest comments. However! The link in the Latest Comments module which will send users to the comments and K2-article is NOT working properly.

When I press the link, I'm not sent to the article itself, as I should. Instead the article is loaded in the content area of the front page.

Try it out yourself at my site: http://norshine.no. First open an article the normal way by chosing one at the frontpage (just scroll down a bit). Then go back to the frontpage and to the Latest Comments, which is located to the right where the module says "Siste kommentarer" (Norwegian) and press one of the comment links.

See my problem? How can I fix this? I've searched the PHP and found this code, which I believe has something to do with it:

Code:
function getContentLink(&$row)
{
global $mainframe, $Itemid;

if (JCOMMENTS_JVERSION == '1.5') {
require_once (JPATH_ROOT.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)) . '#comments';
} else {
$compat = $mainframe->getCfg('itemid_compat');

if ( $compat == null ) {
// Joomla 1.0.12 or below
if ( $Itemid && $Itemid != 99999999 ) {
$_Itemid = $Itemid;
} else {
$_Itemid = $mainframe->getItemid( $row->id );
}
} else if ( (int) $compat > 0 && (int) $compat <= 11) {
// Joomla 1.0.13 or higher and Joomla 1.0.11 compability
$_Itemid = $mainframe->getItemid( $row->id, 0, 0  );
} else {
// Joomla 1.0.13 or higher and new Itemid algoritm
$_Itemid = $Itemid;
}

$link = sefRelToAbs( 'index.php?option=com_content&amp;task=view&amp;id='. $row->id .'&amp;Itemid='. $_Itemid );
}
return $link;
}

Thanks in advance if someone wants to help me Cheesy
Logged
smart
Administrator
Hero Member
*****

Karma: 186
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #1 on: December 06, 2010, 17:05:55 »

The code you've found is used for com_content's links not for K2. The K2 links are generated in com_k2.plugin.php file.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
NorShine
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« Reply #2 on: December 07, 2010, 05:07:13 »

Thanks for the answer! But how can I edit the code so the link will send me to the k2-article itself, and NOT load the article in my frontpage in the main content area?
« Last Edit: December 07, 2010, 15:31:56 by smart » Logged
gimenezadrian
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« Reply #3 on: December 07, 2010, 14:25:44 »

I have the same problem

The link in the Latest Comments module which will send users to the comments and K2-article is NOT working properly.

When I press the link, I'm not sent to the article itself, as I should. Instead the article is loaded in the content area of the front page.

Show modules, shows me home (.com.ar/inicio) instead of the category name!

Example:

Correct: http://www.playersonline.com.ar/noticias/item/102-los-grandes-retailers-brit%C3%A1nicos-aseguran-que-steam-est%C3%A1-matando-el-mercado-de-pc

Show me wrong jcomments latest: http://www.playersonline.com.ar/inicio/item/102-los-grandes-retailers-brit%C3%A1nicos-aseguran-que-steam-est%C3%A1-matando-el-mercado-de-pc#comment-76
« Last Edit: December 07, 2010, 14:30:35 by gimenezadrian » Logged
drkz
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« Reply #4 on: January 27, 2011, 00:59:56 »

anyone fixed this ? or know is there is a workaround? I just don't want to mess with code hacks Smiley

Thanks in advance
Logged
BBC
Full Member
***

Karma: 6
Offline Offline

Posts: 92



« Reply #5 on: January 27, 2011, 19:03:09 »

You have to be using some SEF extension, or Joomla SEF. I had such problems with search module and redirect to search component too.

Best way is to use advanced module manager:
http://www.nonumber.nl/extensions/advancedmodulemanager

Withit you can controle your modules as you want.
Logged
BBC
Full Member
***

Karma: 6
Offline Offline

Posts: 92



« Reply #6 on: January 27, 2011, 22:58:46 »

I mean.....with this manager you make frontpage modules (you don´t want to show with K2 Items) to only Home (frontpage)

And Joomla and SEF respect that.

Then it is useful Module Manager for everything else. You can tex show one module in only one K2 Item. Nowhere else at the site.
Logged
qwesza7
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« Reply #7 on: April 15, 2011, 19:34:27 »

my last comment link not working well for k2 aswell.
the k2 item link is
http://sitename.com/menuname/submenuname/submenuname/item/itemid-itemname.html
but when you click last comment mod link, it lead u to
http://sitename.com/menuname/item/itemid-itemname.html

so the k2 item shows as 'full screen' and none mod will load.

Any one help?? Huh
Logged
yaksushi
Jr. Member
**

Karma: 0
Offline Offline

Posts: 18


Email
« Reply #8 on: June 07, 2011, 16:01:11 »

I'm in the same boat...  Comments work and display perfectly in my k2 articles only issue is when clicking on the link in the latest comments module.  I get sent to the wrong area...  

example for my site the ultimate kayak fishing resource

The module takes me to this url: www yakangler.com/about-us/item/1015-custom-car-top-rack#comment-2768

But it should be taking me to this url: www yakangler.com/articles/how-to/kayaking/item/1015-custom-car-top-rack

I'm only using the built in Joomla SEF.  Anyone fix this?
« Last Edit: April 15, 2013, 01:45:55 by yaksushi » Logged
sanusense
Newbie
*

Karma: 0
Offline Offline

Posts: 2

Stay alive!


WWW
« Reply #9 on: June 08, 2017, 12:42:08 »

Pardon me for commenting here, since this problem isn't resolved yet...that's why putting my views.
I had this issue with my site Kayak Flow , however after spending sometime on tutorials, I found this way.

Go to module manager, open K2 content. Make sure the module is published. Give the module a position. Select the K2 category you want to show. (You can duplicate the module for other categories) Give the module a menu assignment. (I chose "only on pages selected" and them "home") Save it and you are good.

I hope this works for you all.
Logged

coryd
Newbie
*

Karma: 0
Offline Offline

Posts: 1


WWW Email
« Reply #10 on: November 29, 2017, 18:21:35 »

Excuse me for remarking here, since this issue isn't settled yet...that's the reason putting my perspectives.

I had this issue with my site Kayak , however in the wake of spending at some point on instructional exercises, I discovered thusly.
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    K2 JComments    Topic: Latest comment link is loading K2-article on frontpage
 
Jump to: