Facebook Like Droplet

crnogorac081

You have a simplepage head snippet:

http://www.websitebakers.com/pages/modules/various/simple-page-head.php

take a look at attached file, it is version from my site. At line 91 starts FB tags.. You would also have to change lines 98+ ($image variable) to match your news images folder..

cheers,
Ivan




[gelöscht durch Administrator]
Web developer

sky writer

Ah, I see now.  Very nice.

But how do you implement this in your site?

crnogorac081

#27
Hi,

Yea I forgot to clean up some code, you should click on any news item and you will see og tags

EDIT: you will see the valid code on frontpage and news group page. but code become not validated when OG tags appear.. So I dont worry, because it is not up to me :) Everyone have a same problem but there is no  solution..

cheers
Web developer

sky writer

Sorry, I'm not sure what I am looking at, or where it is?  I looked at the source of your page and don't see any og tags.  I checked validation of your page, and it had many reported "errors"... are you saying you have chosen to ignore these issues?

Please clarify.  Thanks!

crnogorac081

Hi,

my portal was kind of perfect (with no errors at all) before facebook and open graph tags appeared :) , and now I am not considering those errors any more.. 

Abs. path to picture is: www.yoursite.xy/media/folder/picture.jpg

take a look at tags on my portal: www.mondocafe.me

cheers,
Ivan
Web developer

sky writer

#24
I still get an error:
QuoteValidation Output: 1 Error

   Error Line 120, Column 55: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

   ...lign: center;"><div id="facebook_like"><!--[if IE]><iframe src="http://www.fac...

   The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

   One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

I also have a question about:

Quote from: biber.beat on March 17, 2011, 12:34:17 AM
Hey! If you set the following Open-Graph-Meta-Infos the droplet is working fine:

   <meta property="og:image" content="absolute_path_to_picture.jpg/>
   <meta property="og:title" content="<?php page_title(); ?>"/>
   <meta property="og:site_name" content="<?php page_title(); ?>"/>
   <meta property="og:description" content="<?php page_description();?"/>

Unfortunally I could not figure out why I have to set an image. Otherwise none-relevant pictures are send to the wall-posting on facebook.

How and where do you add this code?  What do you enter for "absolute_path_to_picture.jpg"

jacobi22

#23
english:
here a resolution without W3C-Errors. the internet explorer need the code "allowTransparency="true"" to display the iframe transparent, but allowTransparency is not W3C-conform

german:
die W3C-Prüfung gibt einen Fehler für allowTransparency aus. der Internet-Explorer benötigt aber diese Angabe. Ohne allowTransparency würde die Box mit schwarzen bzw. weißen Hintergrund dargestellt.
Um den Fehler abzustellen, fügt man eine Abfrage ein, welcher Browser verwendet wird und verwendet je nach Antwort einen Code für den IE (mit allowTransparency) oder für alle anderen Browser ohne allowTransparency

Hier der geänderte Droplet-Code
$host = $_SERVER['HTTP_HOST'];
$self = $_SERVER['PHP_SELF'];
$query = !empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null;
$url = !empty($query) ? "http://$host$self?$query" : "http://$host$self";

$the_perma        = rawurlencode($url);
$the_iframe        = '<div id="facebook_like"><!--[if IE]><iframe src="http://www.facebook.com/plugins/like.php?href='.$the_perma.'&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:auto;"></iframe></iframe><![endif]--><iframe src="http://www.facebook.com/plugins/like.php?href='.$the_perma.'&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:auto;"></iframe><!--<![endif]--></div>';
return $the_iframe;

Bug

Does the facebook like script provided by addthis work as it should or does that give the same result

herojohan

This is extremly handy!


Thank you!

biber.beat

Hey! If you set the following Open-Graph-Meta-Infos the droplet is working fine:

   <meta property="og:image" content="absolute_path_to_picture.jpg/>
   <meta property="og:title" content="<?php page_title(); ?>"/>
   <meta property="og:site_name" content="<?php page_title(); ?>"/>
   <meta property="og:description" content="<?php page_description();?"/>

Unfortunally I could not figure out why I have to set an image. Otherwise none-relevant pictures are send to the wall-posting on facebook.

biber.beat

I found out that it may has to do something with the open-graph meta-infos.

For example: with "og:image" you can set the thumbnail for Facebook and if you set "og:title" fix - the droplet will deliver this info to Facebook.

Here you can see how it works good: http://www.hasenfarm.com/pages/motive/ein-aug-hase.php

crnogorac081

I noticed that too, but could not find the solution yet..

maybe facebook doesnt allow you to like pages, but site only..

cheers
Web developer

biber.beat

Hey,

I use your droplet but I´m faceing the problem, that the code is NOT tranfering the unique url within the "Like it". Online my main-url will be transfered - no matter on wich page I place the droplet.

What do I wrong?

snark

yes I did, it makes a correct link towards the page but the text of the link as it is displayed in facebook is only the website-title + the newspage-title .. not the actual news-item-title


crnogorac081

did you put droplet on long content page ?
Web developer

snark

I tried that but that does not zeem to respond

crnogorac081

Hi,

you can try to set the $url parameter to match your page title..

cheers
Web developer

snark

I would like to use this on a newspage but I would like the newstitle to be displayed along with the page title ... is that possible?


crnogorac081

Web developer

jollylama

haha - I figured it out!!

Go to: Admin Tools/Droplets

Add Droplet and flop in the code!

jollylama

this could be really great! - however i'm not up to speed on droplets - i'm not sure how to add the code.. and where?

any help or tutorials?

thanks!

frankyboy


Stefek

Hello Ivan,

Thanks,

regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

crnogorac081

Hi Stefek,

There is not much code :) I posted it in first post..

cheers
Web developer

Stefek

Hello Ivan,

This is really cool!

I am courious about the code.

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden