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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.