Please integrate Rate in the Panels UI (make it available as a widget or something).

As it stands now, it's very confusing how to make Rate work on Panels pages - to the point where one wants to give up. The documentation on this is rather poor and doesn't provide sufficient step-by-step guidance.

Best,
Thomas

Comments

Anonymous’s picture

if you use panels node template you just have to add "node being viewed" content and uncheck the "no extras" checkbox...

tiw’s picture

Can you please explain? I see all the content of the node get displayed when I do what you have suggested. I don't see the rate widget.

Anonymous’s picture

i'm using the node template page from panels. in the content area of this page i've added "node content" and removed the hook from "no extras". thats it...

tiw’s picture

Thank you for the response.

I can get the rate widget in the panels pane along with the rest of the node content. How can I pull 'only the rate widget' in a pane?

Thanks,

tiw’s picture

I can pull the rate widget now using custom php code given in the README file with the module.

if (arg(0) == 'node' && is_numeric(arg(1)) && $node = node_load(arg(1))) {
  node_invoke_nodeapi($node, 'view');
  print $node->rate_NAME['#value'];
}

Replace NAME by the widget's machine readable name.

However, I also need 'review text' along with the rating. Users will be rating the product and writing reviews. So far, this module has allowed me to rate products, but not write the reviews. Anyone with similar need?

tomogden’s picture

That sounds like another issue, perhaps another module or a sister module.

question4magnet’s picture

I still cant get it to appear on the page. where is this "no extras" checkbox - cant find it anywhere. im using panels-7.x-3.0.

if someone can point me to the right direction, i would really appreciate it.

andypost’s picture

Rate widget should implement hook_field_extra_fields() to be usable in panels and field_ui
Also there's attempt to make rate a field #1244858: Rate field

leschekfm’s picture

Status: Needs review » Active
StatusFileSize
new3.69 KB

In the attached patch I've written a basic integration for panels.
If you have a node context in your page you can insert a widget for this node and choose it's view mode. At the moment I haven't found a way to limit the widgets to choose from to only the ones that are enabled for this nodetype. This means you can insert every widget for every node!

As you now have the option to insert multiple of the same identical widgets at different locations of your page, I would recommend to also apply the patch from #1676746: Addtional Classes and more unique ID. This will add the benefit that all of your widgets get updated automatically if you vote on one.

@mauritsl: Please let me know if you would like to include such functionality into rate or if you would prefer to put this into a seperate module, because then I would create a new project called something like rate_panels/rate_extras.

Edit:
Forgot to mention: the patch is against rate-7.x-1.3

leschekfm’s picture

Status: Active » Needs review
babruix’s picture

Status: Active » Reviewed & tested by the community

Patch works, thank you!

andypost’s picture

@Commiter, please add a new line after patch applied

+++ b/plugins/content_types/rate_widget.inc
@@ -0,0 +1,82 @@
+  return $block;
+}
\ No newline at end of file

Needs a new line at the end of file.

nevergone’s picture

I'm tested with Rate 7.x-1.6 and works well!

jaydub’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
StatusFileSize
new3.27 KB

Rerolled the patch against latest in git which is pretty much the 1.6 release.

mauritsl’s picture

Nice work.
Will see if I can create a 1.7 release in the coming week.

leschekfm’s picture

I think the issue #1676746: Addtional Classes and more unique ID I mentioned in my previous comment should also be included in the upcoming release. So it would be nice if someone could review it.

alexander.sibert’s picture

Any progress here? I want to use Rate module with Panels!

babruix’s picture

2 neofelis1985: patch #14 works, what additional progress are you looking for?

mauritsl’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Patch is committed to 7.x-1.x and included in the 1.7 release. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kopeboy’s picture

Status: Closed (fixed) » Needs work

I found a bug:

  1. add a widget (/admin/structure/rate/1/edit) and set "Appearance in full node" to "Compact"
  2. add the Rate widget through Panels (Node template) with "Build mode" to "RATE_COMPACT"

The voting won't work correctly:

  • If I click on an option, the votes won't update unless I refresh the page.
  • If I visit the Voting results tab before refreshing, votes won't be updated either!

Basically to make it work you have to always set "Appearance" to "Full widget" in the rate widget settings, regardless of what you choose under "Node display" or later in Panels.

  • mauritsl committed 0e92bca on 8.x-1.x
    Issue #1295240 by thomas1977, leschekfm, jaydub: Integrate with Panels
    
ivnish’s picture

Status: Needs work » Closed (outdated)

Drupal 7 is EOL. Issue will be closed, but patches are still here

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.