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

Login with username, password and session length

JoomlaTune Support Forum    Other extensions    Modules    Topic: comments link before article
Pages: [1]   Go Down
  Print  
Author Topic: comments link before article  (Read 2318 times)
0 Members and 1 Guest are viewing this topic.
franksproductions
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« on: January 06, 2011, 22:36:31 »

Hi everyone,

Does anybody know how to place a text link automatically at the top of an article, linking one directly to the comments and comment box below the article? A link saying for instance: react! And when you click it, you go down directly to the bottom of the article. This may be handy for long articles, so that people realize that they have the possibility to place a comment at the end.

I tried to do this through the plugin Content - JComments, parameter "comments link" and "links position: before article", but that doesn't seem to work because nothing comes up at the beginning of the article.

Thanks a lot for any help.

Frank.
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: January 07, 2011, 03:38:18 »

I tried to do this through the plugin Content - JComments, parameter "comments link" and "links position: before article", but that doesn't seem to work because nothing comes up at the beginning of the article.
This parameter affects comments links in blog view...

You can try to modify JComments - Content plugin and add such link. For this try to do next steps:

1. Open file /plugins/content/jcomments.php
2. Find line:

Code: (php)
function onAfterDisplayContent(&$article, &$params, $limitstart = 0)
and add before it next code:

Code: (php)
function onBeforeDisplayContent(&$article, &$params, $limitstart = 0)
{
require_once (JCOMMENTS_HELPERS.DS.'content.php');
$application = &JFactory::getApplication('site');
$view = JRequest::getCmd('view');
// check whether plugin has been unpublished
if (!JPluginHelper::isEnabled('content', 'jcomments')
|| ($view != 'article')
|| $params->get('intro_only')
|| $params->get('popup')
|| JRequest::getBool('fullview')
|| JRequest::getVar('print')) {
JCommentsContentPluginHelper::clear($article, true);
return '';
}

require_once (JCOMMENTS_BASE.DS.'jcomments.php');

$config = & JCommentsFactory::getConfig();
$isEnabled = ($config->getInt('comments_on', 0) == 1) && ($config->getInt('comments_off', 0) == 0);

if ($isEnabled && $view == 'article') {
return '<a href="#comments">'.JText::_('Comments').'</a>';
}
}

This modification will add link 'Comments' before article's text... I didn't tested this modification but it must work...
Logged

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

Karma: 0
Offline Offline

Posts: 2


« Reply #2 on: January 07, 2011, 16:00:04 »

Thanks a lot. I'll give it a try.
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    Other extensions    Modules    Topic: comments link before article
 
Jump to: