Code to use News Images as Facebook go:image tag
Here is the script you need to add to your news_full.html5 template to add a Facebook image by using the News image.
Code:
<?php
$fbimage = $this->getImage($this->urlEncode($this->singleSRC), 512, 512 , 'box');
$GLOBALS['TL_HEAD'][] = '<meta property="og:image" content="' . $this->Environment->base . $fbimage . '" />';
?>
<div class="layout_full"…..
Re: Code to use News Images as Facebook go:image tag
Hello,
It doesn't seem to work with Contao 3.0
Is there an alternative ?
Thank you
Re: Code to use News Images as Facebook go:image tag
Not sure, but this code I wrote for 3.x.
Re: Code to use News Images as Facebook go:image tag
Indeed, it works perfectly.
Thanks !