×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Itemid=1 for comment links from latest comment mod

Itemid=1 for comment links from latest comment mod 15 years 2 months ago #2682

  • aceofspades21
  • aceofspades21's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 0
Whenever I click a comment link in the latest comments module, it will display the article inside my frontpage. Is there something I can do to prevent this? I want the article to appear on its own. When clicking "Read more" on the front page article it properly displays the single article with the correct Itemid. If I could somehow remove the "Itemid=1" from the latest comment module links it would also solve this problem. How can I do this?


Edit:

Alright I figured out a workaround. I was trying to guess which portions of code to delete in the mod_comments.class.php by trial and error but nothing seemed to work. Instead I added a new line to manipulate the $link string.

Original code:
$link = $comObject->linkToContent($post->_item['contentid'], $post->_item['id'], true);

Code with new line added:
$link = $comObject->linkToContent($post->_item['contentid'], $post->_item['id'], true);
				$link = str_ireplace("Itemid=1","",$link);



Just to clarify, links from the module used to look like this by default:
http://www.MYSITE.com/joomla/index.php?option=com_content&view=article&id=103&joscclean=1&comment_id=37&Itemid=1#josc37

Now they look like this:
http://www.MYSITE.com/joomla/index.php?option=com_content&view=article&id=103&joscclean=1&comment_id=37&#josc37

I hope this helps someone else in the future.
  • Page:
  • 1
Time to create page: 0.102 seconds