I'd like to hear from anyone that has implemented a Facebook Like or Share option on their site. I want to replace the Viart Print/Tell Friend links.
Wondering how you dealt with to OG tags so that the correct image, title and description is displayed when you choose to Share something on your site.
I've been looking at ADDTHIS.com
here they say due to FB's requirements you need to implement some (if not all ) of the OG tags that FB is looking for. But I'm not 100% sure on the best way to do this.
I'd love to hear about this as well. I have added the ADDTHIS to my pages, but because Facebook OG isn't currently supported, it pulls the wrong image and such.
dmOZ
21 Jun 2014 12:51 AM
This may help a little bit, i'm still working on my stuff
Not sure how many touch points may be required to get this all to work
I think at the moment it would need to have some modifications to the acutal PHP files generating the current META title/description/keywords tags to also populate additional OG meta tags and then have page_layout.php pick those up and do the actual embedding.
interested to know how you get on.
dmOZ
22 Jun 2014 1:53 AM
So based on my previous comments.
Depending on what you are pushing to FB and how you want to do it you will need to add to page_layout.php something like the following:
** Note: this has not been fully tested for all cases where the actual system properties may have additional HTML or special characters embedded in their content
** The following may be best places entirely within a new CMS block that does all the work which would mean it is cleaner and you can control which pages have the correct OG tags??
page_layout.php:: in the section following "// set some meta data"
Then if you also want to control which image is shown you will have to modify the relevant PHP file (eg block_ad_detail.php) to pull the correct image from the system and then create a
eg in block_ad_details.php:: following "$t->sparse("big_image", false)" at around line 246
// add OG image INFO
$og_small = $site_url.$db->f("image_small");
set_head_tag("meta", array("property"=>"og:image","content"=>$og_small), "property", 1);
In order for this part to work I needed to modify the origin SQL query to also return the small_image from the ad_items table to the following at line 82::