Hi,

Is it possible to add Views support? I want to add the Facebook Like Button to my views.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ajaysolutions’s picture

Seconded, for D6 and D7. Thanks for the module!

jerdiggity’s picture

Assigned: Unassigned » jerdiggity
lukio’s picture

Issue tags: +views, +FB Like

great module !

I did a nice trik so I can use fblikebutton into views.

First, install views_php.
Create a new field php, then copy&paste this code into.

module_load_include('module', 'fblikebutton', 'fblikebutton');
$url = url("node/{$data->nid}", array("absolute"=>"true"));

$addr = variable_get('fblikebutton_block_url', $url);
$conf = array(
  'layout' => variable_get('fblikebutton_bl_layout', "button_count"),
  'action' => variable_get('fblikebutton_bl_action', "like"),
  'color_scheme' => variable_get('fblikebutton_bl_color_scheme', "light"),
  'show_faces' => variable_get('fblikebutton_bl_show_faces', "false"),
  'font' => variable_get('fblikebutton_bl_font', "Trebuchet MS"),
);
print _fblikebutton_field($addr, $conf);

So, you can use views, and fblikebutton.
Hope it help for now.

mwbyrd’s picture

Or just add the code to the footer of the view.

The only issue I see is that the Like button doesn't refresh on a different view...

pwaterz’s picture

That is a hack, need real views integration.

sammyman’s picture

We need Views Support. I need it for 7x. Thanks!

emergencyofstate’s picture

Sub

giorgio79’s picture

davisben’s picture

I took a pass at this. It works for me, but it's only been tested on one site.

davisben’s picture

Status: Active » Needs review
Poieo’s picture

Version: 6.x-1.0-rc5 » 7.x-2.x-dev

Working great for me. Would love to get this committed.

dotist’s picture

patch worked great for me!

caspervoogt’s picture

I don't quite understand why the Dynamic Like Button needs to be restricted to a content type at all. The site I'm working on has some nodes, but it consists primarily of views. It doesn't make sense to add this into a view ... having it as a block that can just be assigned to some region and that *optionally* can be restricted by content type would be fine, I think. The block itself can actually already be restricted by content type, so I don't see why the module needs to do that at all, unless I'm missing something. I may tweak this to make content type optional, because I really don't want to have to assign the same block in two or three different ways when it can just be in a block and be done with it.

Kazanir’s picture

Rerolled the patch in #9 to the latest dev and it appears to be working.

Haidee’s picture

not working for me... got some error message

warning: fblikebutton.info has type 100755, expected 100644
Checking patch fblikebutton.module...
warning: fblikebutton.module has type 100755, expected 100644
error: while searching for:
$output = '

';
return $output;
}

error: patch failed: fblikebutton.module:272
error: fblikebutton.module: patch does not apply

vgutekunst’s picture

Issue summary: View changes

how to get this field in views? I installed the recent version 7.x-2.4 but i didtn get any like button in my view?