Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#12 | fb_social-like-box-not-displayed-on-all-pages-1387708-12.patch | 28.56 KB | das-peter |
#12 | diff-with-ignored-spaces-at-eol-do-not-test.diff | 3 KB | das-peter |
Comments
Comment #1
ferdi CreditAttribution: ferdi commentedCan 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 ?
Thanks!
Comment #2
TravelTechie CreditAttribution: TravelTechie commentedSame 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.
Comment #3
TravelTechie CreditAttribution: TravelTechie commentedLooking 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.
Comment #4
ferdi CreditAttribution: ferdi commentedI 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.
thanks!
Comment #5
Summit CreditAttribution: Summit commentedIt looks like this module only works on node pages [NID], right? I need it also D6/D7 on other pages than nodes.
greetings, Martijn
Comment #6
calbasiHello,
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.
Regards
Comment #7
uno CreditAttribution: uno commentedDisable block caching, it usually helps.
Comment #8
calbasiNo block caching enabled, in my case ;-)
Comment #9
janv CreditAttribution: janv commentedsubscribe, same problem
Comment #10
particlegirl CreditAttribution: particlegirl commentedsubscribe same problem on IE, FF & Chrome, need it for products.
Getting a blank space appearing but its empty for both dynamic and static :-)
Comment #11
das-peter CreditAttribution: das-peter commentedMy 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 infb_social_page_alter()
will always fail andFB.init(...
isn't added to the page output.I see two approaches to workaround this:
$_fb_script_init
check.$_fb_script_init
toTRUE
. This would allow to control where the script has to be added (Path filters) and could even be used together with panels.Better ideas? :)
Comment #12
das-peter CreditAttribution: das-peter commentedI 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.Comment #13
bianchi CreditAttribution: bianchi commentedWhat's the javascript sdk for this module ? can you be more specific ?
thanks
Comment #14
bianchi CreditAttribution: bianchi commentedit 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;>
Riko's site,edited on tpl file
Test on html.tpl.php inside sites/all/themes/steve_sommerfeld/templates/html.tpl.php
-->
print t('Skip to main content');
print $page_top;
print $page;
//print $page_bottom;
Comment #15
mezitlab CreditAttribution: mezitlab commentedIf 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.
Comment #16
Summit CreditAttribution: Summit commentedHi,
Is this bug known by display suite?
greetings, Martijn
Comment #17
mezitlab CreditAttribution: mezitlab commentedHi 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.
Cheers,
Zoli
Comment #18
mezitlab CreditAttribution: mezitlab commentedRegard my posts (#15 and #17) invalid, please. I was careless.
Comment #19
gb2world CreditAttribution: gb2world commentedThe 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.
Comment #19.0
gb2world CreditAttribution: gb2world commentedjust noticed!