Hi, I have a news page that the user can enjoy and share the news. Every news has its specific image. In some news there is a specific photo album. When there is the album for news, facebook sharing picks up an album image and not the news image.
I searched around and found that I should use the og: image meta tag, but I just can not do that, just look at my code
The image is inserted in the news table. no action:
$this->imagem = Doctrine_core::getTable('tbnews')
->createQuery('im')
->select('im.id, im.imagem')
->where("im.imagem != ''")
->andWhere('im.id = ', $request->getParameter('id'))
->limit(1)
->execute();
$response = $this->getResponse();
$response->addMeta("og:image", "http://www.meusite.gov.br/upload/noticias/<?php echo $this->imagem;");
And that's what I get for page rendering:
<meta content="http://www.meusite.gov.br/upload/noticias/<?php echo <pre> Doctrine_Collection data : Array( 0 : Object(tbNews) ) </pre>; ?>" name="og:image">