Hi,

Would there be any way to allow for comments to be a part of the 5-star block, much like they are in the standard node interface? I need to keep my rating in a block, but would like the comment functionality not to be lost...

Thanks!

-Daniel

CommentFileSizeAuthor
#4 fivestar_comment_block.png22.26 KBquicksketch

Comments

quicksketch’s picture

Anything that allows comments to be posted in a block would enable this, but since posting comments isn't the functionality of Fivestar, this falls outside of the functionality Fivestar will provide.

However, you can implement your own block that displays the comment form rather easily, using a custom block that contains PHP code:

$edit = array('nid' => arg(1));
print drupal_get_form('comment_form', $edit);

There's probably a module that provides this same functionality, but I haven't bothered to look.

quicksketch’s picture

Category: feature » support
daneyuleb’s picture

Thanks for the reply. I guess I'm confused, or wasn't clear.

When adding 5-star when creating content there is a "5 star comment settings option". So there would seem to be comment functionality within 5-star, right? Or am I confused as to how that is implemented? (I'm new to Drupal, so I may be missing something obvious).

When adding a 5 star block, no such "5 star comment settings" exists. Just adding a comments block would have no ability to rank--it would just be a comment list. I'm looking for the same functionality that is in the normal 5 star content creation form, ie, the ability to turn on comments integrated with 5-star (allowing rankings within the comments in the block, with the option of showing the average in the "main" ranking display at the top of the block--much like it works when done for non-block content).

Wasn't sure if this was an option I was missing so I hesitated to put it in as a feature request but if indeed there's no current option for doing so, I can post it as such.

-Daniel

quicksketch’s picture

StatusFileSize
new22.26 KB

I'm pretty sure I'm understanding you correctly. See screenshot of the end result of my previous suggestion.

Yes, Fivestar offers integration with comments, making it so that you can leave a rating along with comment, effectively creating simple "reviews". The way Fivestar does this is by modifying the comment form and simply adding in stars in addition to the normal "title" and "comment" fields. What you're asking for is a way to put the comment form in a block (which includes the Fivestar rating field by association). Because this deals with printing out the comment form, it doesn't make sense for Fivestar to provide this functionality, so you'll either need to find a module that puts the comment form in a block, or use the custom PHP code I posted above.

For testing, I also came up with code that should be used in the "Visibility Settings" for the block, using the "Show only if PHP code returns TRUE":

if (arg(0) == 'node' && is_numeric(arg(1))) {
  $node_type = 'story';
  $node = node_load(arg(1));

  if ($node->type == $node_type) {
    return TRUE;
  }
}
quicksketch’s picture

Status: Active » Closed (fixed)