Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Topic Information
dmOZ
dmOZ
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.
 
http://support.addthis.com/customer/portal/articles/1303425-facebook-open-graph-tags
 
Metz
Metz
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
dmOZ
This may help a little bit, i'm still working on my stuff
 
Tool to debug your page ofr FB:OG tags
https://developers.facebook.com/tools/debug/
 
AddThis reference to the tags in question
http://support.addthis.com/customer/portal/articles/1303425-facebook-open-graph-tags
 
 
What I think has to happen is in the the page_layout.php code - similar to what ARKID did for auto-adding meta data
http://www.viart.com/improving_seo_in_viart_4-adding_failsafe_keyword_and_description_meta_tags.html
 
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
dmOZ
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"
 
set_head_tag("meta", array("property"=>"og:description","content"=>strip_tags($meta_description)), "property", 1);
 
set_head_tag("meta", array("property"=>"og:url","content"=>htmlspecialchars($canonical_url), "property", 1);
 
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::
 
$sql .= " i.image_small, i.image_large, i.price, i.quantity, i.availability, i.is_compared, i.user_id, ";