Read Comments link position on frontpage

Monty 06 Oct, 2008
Hello. How I can show the text of "Read Comments... >>" in the same line than Author and Date of article, on frontpage?
I know how to add the code on template and the place, but I don't know what code would be...

For example, I was testing other component of comments a few days ago. And solution was:

<?php if ($this->item->params->get('show_create_date')) : ?>
<?php echo JHTML::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2')); ?>
<?php endif; ?>

<?php if (isset($this->item->comments)) : ?>
<?php echo $this->item->comments; ?>

<?php endif; ?>

</td>
</tr>


Sorry for my english...
Sadowskin 06 Oct, 2008
I don't recommend messing with code you didn't write yourself.

The plugin shows the link AFTER every article you select in your config of the component, which I think is a logical choice.
It is not a parameter for now so Max? the author, didn't intend for you to change that.

But since you're asking for it; here's some Help for Today's Problems :wink: :

OPEN {joomla}\plugins\content\ChronoComments.php
FIND on line 5 and REPLACE $mainframe->registerEvent( 'onAfterDisplayContent', 'plgContentChronocomments' );
BY
$mainframe->registerEvent( 'onBeforeDisplayContent', 'plgContentChronocomments' );

----
edit: and maybe read this too:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=17&t=11270
Max_admin 06 Oct, 2008
issue fixed in V1.2 already out, thanks Sadowskin!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 31 Oct, 2008
Hi derok, if so then it will appear after the article separator which is not good for blog pages!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kbrookes 28 Mar, 2009
Hi there,

Not sure where I'm going wrong here, but I'm using both ShareThis and ChronoComments.

I'm not using the Joomla plugin version of ShareThis as it creates too many validation errors, just the script straight off the ShareThis site.

I'm trying to make a bar at the bottom of each article that looks like this (not visually, just structurally) :

ShareThis | Comments | Continue Reading

So far, I've got it looking like this:

Comments
ShareThis | Continue Reading

I just can't seem to figure out how to get ChronoComments to display in the same containing element as the other two. My template override for com_content/frontpage/default_item.php so far looks like this:

<?php echo JFilterOutput::ampReplace($this->item->text); ?>


<p>
	<script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=ea400d0c-edaa-4f99-9234-2ad52a994f42&type=website"></script>
	<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
	<a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">
		<?php if ($this->item->readmore_register) :
			echo JText::_('Register to read more...');
		elseif ($readmore = $this->item->params->get('readmore')) :
			echo $readmore;
		else :
			echo JText::_('Read more...');
		endif; ?></a>
	<?php endif; ?>
</p>


<?php echo $this->item->event->afterDisplayContent; ?>


Any help would be appreciated.
Max_admin 28 Mar, 2009
Hi kbrookes,

the read x comments link is just the same as the read more link but has an #comments anchor at the end of the link, so add this to your read more link string and it will work fine!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kbrookes 28 Mar, 2009
I think I understand what you mean, but I'm not sure how to implement it.

On line 144 of plugins/content/ChronoComments.php I see the following code:
$language = '<a class="comments" href="'.$page_link.'#comments">'.JText::_( 'READ N COMMENTS' )."</a>";


Are you saying I can move this code to my html/com_content/frontpage/default_item.php template override?

If so, how do I handle ChronoComment's conditional statements that regulate its appearance?

I'm not much of a php guy, any more specific help would be great....

Thank you!

K
Max_admin 29 Mar, 2009
Hi K,

no I mean that you use this code :

<?php echo $this->item->readmore_link."#comments"; ?>


this will be the href part of the comments link, just as the read more link BUT with comments anchor!

if you want to regulate when it appears then you need to use this code:


$configs = JComponentHelper::getParams('com_chronocomments');
if((in_array($row->sectionid, (array)$configs->get('comment_sections')))||(in_array($row->catid, (array)$configs->get('comment_categories')))||(in_array($row->id, (array)$configs->get('comment_articles')))){
		
//show the link
}


Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kbrookes 29 Mar, 2009
Hi Max, I really appreciate the help. Unfortunately, I'm just not that php-savvy. HTML, CSS, no probs, but I'm only good for very basic changes.

So I'm not sure whether I haven't explained myself properly or if I'm just not capable of finding the right way to insert the code you've provided.

Here's what I've currently got on the page:
Read Comments link position on frontpage image 1

Here's what I'd like to make it look like:
Read Comments link position on frontpage image 2

My existing code looks like this:
<?php echo JFilterOutput::ampReplace($this->item->text); ?>


<div class="actions">
	<script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=ea400d0c-edaa-4f99-9234-2ad52a994f42&type=website"></script>
	
	<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
	<a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">
		<?php if ($this->item->readmore_register) :
			echo JText::_('Register to read more...');
		elseif ($readmore = $this->item->params->get('readmore')) :
			echo $readmore;
		else :
			echo JText::_('Read more...');
		endif; ?></a>
	<?php endif; ?>
</div>


<?php echo $this->item->event->afterDisplayContent; ?>


I tried doing this, but it wound up looking like this:

Read Comments link position on frontpage image 3

Sorry to be such a pain, I feel like I'm close, but that I'm failing to understand something fairly basic.
Max_admin 30 Mar, 2009
Hi,

this code you have:

 <a href="<?php echo $this->item->readmore_link; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">


you will need to make it with:

<a href="<?php echo $this->item->readmore_link."#comments"; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">


this will create the anchor item for the comments link, so it takes you to the comments part, lets get this done first!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kbrookes 30 Mar, 2009
Thanks Max.

That's now done and working as you suggest: my read more link now takes the user to the new page at the comments anchor.

Live site is here, btw:

http://tvproductionforum.com/

Ready for your next step....
Max_admin 01 Apr, 2009
Good, next step is to use this code:

    $configs = JComponentHelper::getParams('com_chronocomments');
    if((in_array($row->sectionid, (array)$configs->get('comment_sections')))||(in_array($row->catid, (array)$configs->get('comment_categories')))||(in_array($row->id, (array)$configs->get('comment_articles')))){
          
    //show the link
    }


around the link we created so it controls if the link will be shown or not depending on if this content item has comments enabled or not!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kbrookes 01 Apr, 2009
Hi Max,

Thanks for the reply, but I'm not sure we're on the right track here.

My code now looks like this:
<?php echo JFilterOutput::ampReplace($this->item->text); ?>



<div class="actions">
	<script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=ea400d0c-edaa-4f99-9234-2ad52a994f42&type=website"></script>
	
	<?php if ($this->item->params->get('show_readmore') && $this->item->readmore) : ?>
	   <?php $configs = JComponentHelper::getParams('com_chronocomments');
    if((in_array($row->sectionid, (array)$configs->get('comment_sections')))||(in_array($row->catid, (array)$configs->get('comment_categories')))||(in_array($row->id, (array)$configs->get('comment_articles')))){ ?>
          
    <a href="<?php echo $this->item->readmore_link."#comments"; ?>" class="readon<?php echo $this->item->params->get('pageclass_sfx'); ?>">
   <?php } ?>
	
	
		<?php if ($this->item->readmore_register) :
			echo JText::_('Register to read more...');
		elseif ($readmore = $this->item->params->get('readmore')) :
			echo $readmore;
		else :
			echo JText::_('Read more...');
		endif; ?></a>
	<?php endif; ?>
</div>


<?php echo $this->item->event->afterDisplayContent; ?>


And the page displays like this:

Read Comments link position on frontpage image 4

The comments link above everything else (that I want to get rid of) is being generated by Chrono.

Is there another step to get it to here?:

Read Comments link position on frontpage image 5

Thanks for your help so far...
Max_admin 15 Apr, 2009
Hi,

sorry but I was crazy busy with Chronoforms the last few days, I think you have already solved the issue but its a layout issue and I can't help much with it anyway!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
marco13 28 Apr, 2009
hey,

how can i get the item (read n comments) to the top of the article?
Unfortunately this doesn´t help:

OPEN {joomla}\plugins\content\ChronoComments.php
FIND on line 5 and REPLACE $mainframe->registerEvent( 'onAfterDisplayContent', 'plgContentChronocomments' );
BY
$mainframe->registerEvent( 'onBeforeDisplayContent', 'plgContentChronocomments' );



I tried to get it working for some hours yesterday, but i got no solution for this issue ?
Moreover i tried to edit the com_content/frontpage/default_item.php file but whatever i did the link with
the comments was on the bottom.

I hope you can help me with this issue.
Thanks in advance

marco
This topic is locked and no more replies can be posted.