Skip to content

Instantly share code, notes, and snippets.

@jommbee
Created June 14, 2013 15:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jommbee/5782828 to your computer and use it in GitHub Desktop.
Save jommbee/5782828 to your computer and use it in GitHub Desktop.
Facebook Image in Contao
//Newstemplate "news_full.tpl" eingefügt werden:
<?php
$GLOBALS['fbImage'] = $this->singleSRC;
?>
//Das Template "fe_page.tpl" muss um folgenden Quellcode im Head-Bereich (<head>...</head>) erweitert werden.
<?php
if($GLOBALS['fbImage']){
echo '<meta property="og:image" content="'.$this->base.$GLOBALS['fbImage'].'" />';
}
?>
//prüfen ob der bPfad richtig übergeben wird
//https://developers.facebook.com/tools/lint/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment