• Edit
  • Delete

Facebook Cheatsheet

OpenGraph debugger

https://developers.facebook.com/tools/debug/

Metas

<meta name="og:title" content="ullCms - manage your content" />
<meta name="og:description" content="A cms never seen before. So easy, such a time saver!" />
<meta name="og:site_name" content="ull.at" />
<meta name="og:url" content="http://www.ull.at/cms" />
<meta name="og:image" content="http://www.example.com/images/foo.jpg" />
<meta name="og:image" content="<?php echo image_path('logo.png', true) ?>" />

In a Symfony template:

<?php sfContext::getInstance()->getResponse()->addMeta('og:title', $item['title']) ?>
<?php sfContext::getInstance()->getResponse()->addMeta('og:description', $item['body']) ?>
<?php sfContext::getInstance()->getResponse()->addMeta('og:site_name', 'MySite') ?>
<?php sfContext::getInstance()->getResponse()->addMeta('og:url', $url) ?>

<?php sfContext::getInstance()->getResponse()->addMeta('og:image', image_path(logo, true)) ?>


Tell Facebook which image to use from a website

<meta name="og:image" content="http://www.example.com/images/foo.jpg" />

In a symfony template use first image of ullWidgetGallery:

<?php // Facebook main image ?>
<?php $images = ullMetaWidgetGallery::getImagesAsArray($doc['photos']) ?>
<?php $main_image = reset($images) ?>
<?php sfContext::getInstance()->getResponse()->addMeta(
  'og:image',
  'http://' . sfConfig::get('app_server_name') . $main_image
) ?>

Other Stuff

Facebook paid likes fraud: https://www.youtube.com/watch?v=oVfHeWTKjag