Rating & Comment

More
14 years 4 months ago #20214 by harky
Rating & Comment was created by harky
Hi,
i understand that rating is included in the plugin.

may i know what abt comment? how can i add the comment under the rating? or i need to d/l a extension?

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #20215 by ggppdk
Replied by ggppdk on topic Rating & Comment
Inside your template folder, edit the file item.php (it creates the html of each item):
e.g.
components/com_flexicontent/templates/mytemplate/item.php

FIND the code that creates the comments:
Code:
<!-- BOF comments --> <?php if ($this->params->get('comments') && !JRequest::getVar('print')) : ?> ... ... <!-- EOF comments -->
Find the template position that you have inserted the ratings field (the field name is voting) and then move the above code just after the lines
Code:
<div class="value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div>

Finally alter the line:
Code:
<?php if ($this->params->get('comments') && !JRequest::getVar('print')) : ?>
to:
Code:
<?php if ($field->name=='voting' && $this->params->get('comments') && !JRequest::getVar('print')) : ?>


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #20316 by harky
Replied by harky on topic Rating & Comment
hi , i installed jcomments
do i still need to put these code in?

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #20321 by ggppdk
Replied by ggppdk on topic Rating & Comment
No, the changes were just if you want the comments to appear in page in a different place (bellow ratings), otherwise make no changes and comments will appear at the bottom.

Don't forget to enable comments in FLEXIcontent's Global Configuration, and then you can toggle this setting on/off per category (in the category parameters)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #20348 by johnlewisdesign
Replied by johnlewisdesign on topic Rating & Comment
On this note, how would I (1) show and (2) expand commments by default in the category view? I need all comments showing without any clicks, but am yet to find ONE commenting solution that allows it. I have category comments on, and I also have the global comments on. No comments showing at all.

Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #20410 by ggppdk
Replied by ggppdk on topic Rating & Comment
To make it expand you could call the javascript that is on the onclick event when the page finishes loading.

For example to make open the comment submit form
Put the following in the item.php of your template

<?php
$opencomments_js = "
var box = {};
window.addEvent('domready', function(){
jcomments.showForm(".$this->item->id.",'com_flexicontent', 'comments-form-link');
});
";
$document
$document->addScriptDeclaration($opencomments_js);
?>

The comments are not displayed in category view, the setting you say is meant to be inherited by items for their item view.

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #20414 by johnlewisdesign
Replied by johnlewisdesign on topic Rating & Comment
Thanks for this, great stuff. I will implement this in a second as its halfway to getting where I need.

But, back to the original question though, is there absolutely no way to have the comments showing on category view? Can I hack the category view page and add the comment code manually? Its a requirement not an option for me, it needs to work just like Facebook's wall, displaying topics + comments all fully expanded. Like I say I'm yet to find anything that can do this; and really really want to continue using flexicontent on this site as its otherwise perfect for my needs.

Thank you for such a wonderful component!

John

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #20418 by ggppdk
Replied by ggppdk on topic Rating & Comment
Some improvements about integration with jcomments are planned.

About what you ask for category view and comments per item

why don't you just copy the code from item.php to the category_items.php and test ?
Code:
<!-- BOF comments --> <?php if ($this->params->get('comments') && !JRequest::getVar('print')) : ?> <div class="comments"> <?php if ($this->params->get('comments') == 1) : if (file_exists(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php')) : require_once(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php'); echo JComments::showComments($item->id, 'com_flexicontent', $this->escape($item->title)); endif; endif; ?> </div> <?php endif; ?>
I altered above the $this->item->id to be $item->id,
so be sure to place this code inside the
Code:
<?php foreach ($items as $item) : ?> ...... <?php endforeach; ?>

Be careful how you place it inside the loop, e.g. the default template uses a table, if you don't form the table properly the comments will appear outside the table or your page will break completely !!!

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #20429 by johnlewisdesign
Replied by johnlewisdesign on topic Rating & Comment
Ohhh man you are a LEGEND!!

I am going to get straight on this now (backing up first, of course!).

I will post you the finished result if you like. If it works, maybe it can be a nice feature for a future release - as I said, there is not one other component that can do this out of the box, so it could be a nice ace up your sleeve!

SO HAPPY! :-) )

Kindest regards,

John

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #20512 by johnlewisdesign
Replied by johnlewisdesign on topic Rating & Comment
ggppdk that was some reply man, thank yo so much again!

Its all working - exactly how I visualised it!

I just need to add some sort of real-time comment watching/loading (like facebook) and a bit of drag and drop positioning, and I have the exact solution I was looking for! The post/comment Mechanics are perfect :D

I'm pretty sure I can grab some off-the-shelf scripts for - drag and drop layouts
- collapsible areas
and incorporate them, now I know where I'm looking.

I modified components/com_flexicontent/templates/blog/category_items.php

This file is attached.

Woo hoo!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save