Using OG:Image to generate Thumbnail for Facebook

Discussion in 'Modules / Plugins / Modifications' started by performancecentral, Apr 7, 2012.

  1. Hey all,
    Some of you may have tried to share a link on Facebook and it always defaults to the same thumbnail or none.

    I would like it when I share a listing link it will pull the first thumbnail image from my view listing page.

    I know I have to ingrate this in somehow

    <meta property="og:image" content="http://www.performancecentral.com.au/photos/{$image.image}" />

    But I am unable to input that in to the viewlistings.tpl file,
  2. Mike-N-Tosh Owner

    You wouldn't put that in the view listings.tpl file you would put it in the layout.tpl file...
    Check the variables with smarty debug first {debug}
    but you can just use smarty logic in the <head> on the layout.tpl similar to this with the correct variables:
    {if $template="viewlisting.tpl"} <-- check this variable to ensure it is correct
    <meta property="og:image" content="http://www.performancecentral.com.au/photos/{$image.image}" /> <-- check this variable too
    {/if}

    You would also most likely want the pic to be the thumbnail pic.
  3. user2616 Customer

  4. Thank you heaps for the advice worked perfectly.

Share This Page