Youjoomla Support Forums (
-   Your Sites (
-   -   Suggested mod to include Facebook OG properties (

adiehm 11-01-2013 07:36 PM

Suggested mod to include Facebook OG properties
I have used YGSG as the base template for a few website now and I thought I would share a mod that I incorporate.

This mod will append all the OG parameters that Facebook requires and lets you manipulate the default facebook like image

File : yjsg_head.php
Location in the file : Right at the bottom before the php close tag "?>"
Code to insert :

$mydoc2 =& JFactory::getDocument();
$title = $mydoc2->getTitle();
$description = $mydoc2->getDescription();
$document->addCustomTag('<meta property="og:image" content="'.$yj_site.'/images/system/facebook-like.jpg" />');
$document->addCustomTag('<meta property="og:url" content="'.JURI::base().'?view=featured" />');
$document->addCustomTag('<meta property="og:title" content="'.$title.'" />');
$document->addCustomTag('<meta property="og:description" content="'.$description.'" />');

You have to add your default facebook image (facebook-like.jpg) in the following folder:

You can test the results in the facebook developers site:

Hope this helps someone :)

Are you sure your are posting in product assigned forum?: Yes

What is your CMS version?: Joomla 3.x

MySQL Version: 5.x

PHP version: 5.x

Link to installation: JTAA - Community Consultation - Stakeholder Engagement

Have you edited any files? If yes tell us which ones.: Yes

Is this personal or client website?: Client

All times are GMT -4. The time now is 08:20 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.