On my bilingual Drupal 7 website, the fb like box block is not always displayed in the left sidebar. I've set it up to appear for all node types and only for unregistered users but still, it's not displayed on some pages. I just noticed that the FB like box is not displayed on views pages and webform pages. It's displayed successfully on "simple" node pages.

Members fund testing for the Drupal project. Drupal Association Learn more


ferdi’s picture

Can you elaborate a bit more ? If you created a preset and checked "create a block" then that's like any other drupal block. The same goes for views pages ?
Or I'm not understanding this correctly ?

TravelTechie’s picture

Same issue here. The like box loads (after creating a block) displays on front page, but gives error message when you try to like it. Seems it is passing fb:app_id when I haven't put in my appid. I also does not display on some content types and taxonomy pages.

TravelTechie’s picture

Looking into it further it seems that for both Html5 and FBML the Javascript SDK is not loading at all in some cases, but always for the above mentioned scenarios. Does this install the sdk library. I could not find it in the module folder, however when I included it in my html.php template file after the body tag it worked on every page.

ferdi’s picture

I cant reproduce this. Btw, app_id is not needed for the like box plugin. No sdk library is needed.
It would be great to have some more info about your setup , if anything special. Extra modules etc.

Summit’s picture

It looks like this module only works on node pages [NID], right? I need it also D6/D7 on other pages than nodes.
greetings, Martijn

calbasi’s picture

Version: 7.x-2.0-beta3 » 7.x-2.0-beta4
Issue tags: +views, +facebook, +fb_social, +likebox, +grip, +horizontal tabs


Here I have the same problem (7.x-2.0-beta4). Likebox is only shown on certain pages:

- It runs OK in simple nodes, contact form, some views
- It doesn't run at any views that use GRID style, and nodes using field_group and horizontal tabs.


uno’s picture

Disable block caching, it usually helps.

calbasi’s picture

No block caching enabled, in my case ;-)

janv’s picture

subscribe, same problem

particlegirl’s picture

subscribe same problem on IE, FF & Chrome, need it for products.

Getting a blank space appearing but its empty for both dynamic and static :-)

das-peter’s picture

My wild guess is that this can be related to some caching.
If fb_social_preprocess_fb_social_plugin() isn't executed because the output is already cached, the global variable $_fb_script_init isn't set - thus the check for this variable in fb_social_page_alter() will always fail and FB.init(... isn't added to the page output.

I see two approaches to workaround this:

  1. Add an option to always add the script. Basically that's a simple bypass of the $_fb_script_init check.
  2. Provide a "hidden" block which only purpose is to set $_fb_script_init to TRUE. This would allow to control where the script has to be added (Path filters) and could even be used together with panels.

Better ideas? :)

das-peter’s picture

I decided to give this a shot. Here's the patch with both approaches implemented.
Since there where quite some spaces at eol in the current code the patch looks huge - to see the changes I really made please take a look into diff-with-ignored-spaces-at-eol-do-not-test.diff.

On our page we likely will use the special block in the appropriate panels variants to ensure that window.fbAsyncInit is available.

bianchi’s picture

What's the javascript sdk for this module ? can you be more specific ?

bianchi’s picture

it works for me :

Give a patch on : html.tpl.php on my theme file :

print $doctype;
print $language->language; " dir=" print $language->dir; " print $rdf->version . $rdf->namespaces; >
print $rdf->profile; >
print $head;
print $head_title;
print $styles;
print $scripts;

print $attributes;>

<strong><div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=439676599409533";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Riko's site,edited on tpl file

Test on html.tpl.php inside sites/all/themes/steve_sommerfeld/templates/html.tpl.php


print $page_top;
print $page;
//print $page_bottom;

mezitlab’s picture

If a node type uses a display suite (7.x-1.5) layout - the FB like button plugin doesn't appear.
Switching off display suite layout for the same node type - the FB like button plugin display correctly in the node page.

There is/was a very same situation with metatag module.

Summit’s picture

Is this bug known by display suite?
greetings, Martijn

mezitlab’s picture

Hi Martijn,
I think that this bug didn't know by the DS's developers. For example addthis module also unable to operate with DS. I think there are other modules too.
When the metatag's developer changed something in their own module then it started work with DS. But I don't know what was it. Maybe the modules that want to work with DS must have a function or a part of a code that DS needs. I don't know what is it at time. I have to more understand this situation.

mezitlab’s picture

Regard my posts (#15 and #17) invalid, please. I was careless.

gb2world’s picture

The approach and patch described in #11 and #12 are very helpful. I had social plug-ins created as blocks which were intermittently displayed when inside panels or used on panel pages. The social plugin initialization was not happening after some caching events that I could not quite replicate. The "always on" options seems to me to be a good solution.

gb2world’s picture

Issue summary: View changes

just noticed!