Hello,

I am using dispaly suit to display my fields of node, so when i show the node, i don't see the plus one button. If i don't use display suit the button show up.
Any help will be appreciated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nbucknor’s picture

Title: Plus 1 button not show when using display suit » Plus 1 button not show when using display suite
FileSize
24.59 KB

You can create a custom preprocess field with "plus1_widget" as the machine name:
http://example.com/admin/structure/ds/fields/manage_preprocess

Once you do that, you can put that Plus1 field anywhere in your display suite layout.

wjackson’s picture

All you have to do is give it a machine name of "plus1_widget"? I created a preprocess field attempting to load Plus1 with no luck.

nbucknor’s picture

FileSize
2.91 KB

If the view mode you've enabled it on is either the "Teaser" or the "Full content", and those view modes are also enabled in your Plus1 config settings (admin/config/user-interface/plus1), then it should work without any code changes.

I don't think it will work on other view modes without patching the Plus1 module or creating your own hook_node_view() function to create the 'plus1_widget' variable for other view modes.

I created a patch that exposes all view modes to the Plus1 configuration settings, but haven't had time to clean up the code and recontribute it. You can use it if you want.

Spark_man’s picture

Worked perfectly for me - it was a little tricky setting the machine name correctly, but once done, it behaved beautifully.

Thanks!

rogical’s picture

Status: Active » Needs work

It's not a git patch, please re-roll, I'll commit this.

wwhurley’s picture

Status: Needs work » Needs review
FileSize
2.85 KB

Attached is a re-rolled patch based on #3.

nbucknor’s picture

fixed and re-rolled patch using latest dev version of module

rogical’s picture

Status: Needs review » Reviewed & tested by the community

set rtbc first

rogical’s picture

Status: Reviewed & tested by the community » Fixed

committed

Status: Fixed » Closed (fixed)

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