Setting varibales for FB OG metadata

edited February 2014 in Share
When we first created our site we set up some Facebook Open Graph metadata so that links send to FB would have a specific format. We put this format in our header (extra spaces after first carrot just so it will show up here):

< meta property="og:image" content="http://oursite.com/assets/images/ourimage.jpg" />
< meta property="og:title" content="Meet Us" />
< meta property="og:description" content="We are your system for..." />

But now we want to have a few specific pages that have their own OG metadata for a promotion and I've tried a couple different techniques without success such as trying to set variables in _variables/global.php or just switching out the first line with:

< meta property="og:image" content="<?=fuel_var('og_image', 'http://oursite.com/assets/images/ourimage.jpg') ?>" />

and then in my view setting the var like this:

<?=fuel_set_var('og_img', 'http://oursite.com/assets/images/adifferentimage.jpg')?>

Neither of these worked. Does anyone have other recommendations or just things I might have done wrong using either of these techniques?

Comments

  • edited 9:20PM
    You appear to be using 'og_img' for fuel_set_var instead of 'og_image'. Could that be the problem?
  • edited 9:20PM
    I think it was. Thanks for catching my typo. Sometimes no matter how many times you scan for small things and typos you need another pair of eyes to see it. Thanks!
Sign In or Register to comment.