Jump to content

Facebook Opengraph META tags and PHP variables


etymole

Recommended Posts

Hi there.

 

Having a little trouble getting Open Graph working with my facebook like button. I can put text in fine but I want the following variables to be represented in the head information so that I can edit the head data periodically. Would appreciate any help. I've tried "<?php echo $blahblah ?>" which doesn't seem to work. Confirmed that nothing was being pulled by Facebook's linter...

 

//Variable for Head.
$id = '1';
$promo_id = $id; //Change this to be variable with function...
$promo_title = "Goody Bag";
$promo_text = cms::string('copy.goody_bag.sub_title');
$promo_image = "/assets/images/goody_bag/goody_bag_small_bg.png";//Change this to be variable with function...
$promo_description = cms::string('copy.goody_bag.text');
//These are to be put into the head information but will need to be made variable using either the controller or the iframe.php 
?>


<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:og="http://opengraphprotocol.org/schema/"
      xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>
    <title></title>
    <meta property="og:title" content="Goody Bag"/>
    <meta property="og:type" content="website"/>
    <meta property="og:url" content="http://apps.facebook.com/ztoa_dev/like/show_like/1"/>
    <meta property="og:image" content="http://apps.facebook.com/ztoa_dev/assets/images/goody_bag/goody_bag_small_bg.png?2"/>
    <meta property="og:site_name" content="Z to A by Sunsilk"/>
    <meta property="fb:admins" content=""/>
    <meta property="og:description"
          content="Blah Blah Blah"/>
</head>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.