Page 2 of 2
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 18 May 2014, 13:20
by JB2U
This is not a solution but more info. I downloaded Phoca OG out of desperation - but that hasn't worked. I have in the past been able to either use a plugin or manually configure og properties on index.php to get them scraped. But even without this, FB was displaying at least title and description on FB shares until last week. And then something happened - basically even on older site with og properties, FB just stoped displaying them wrong on shares. Note that when testing, the og tags are being picked up on Google+ and LinkedIn shares. I've spent the last three days changing the fb share button, getting and FB app_id so I could use the FB SDk and nothing has worked. If you look on forums, this is not just a Joomla problem. WordPress websites and plugins are also having the same problem - but the REAL problem is it's impossible to check what's causing it because it's so intermittent. Some sites are affected, some not. I thought it was the upgrade to J 3.3 that caused it, but a backup I took of an earlier site in 3.3 is displaying og title and description properly (there was no relevant images). So I am posting this in case anybody finds a solution. If I find one I will post. But that might entail creating a totally fresh Joomla site for testing purposes - and that's a mission and I am not sure I have the time. Good luck and keep posting.
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 18 May 2014, 14:40
by JB2U
I solved my problem: Turn off Gzip in global configuration. Sorry if this isn't your problem, but I hope it helps somebody. I am no using Phoca again ...
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 18 May 2014, 23:30
by Jan
Ok, thank you for the information.
Jan
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 25 May 2014, 19:52
by xaashley
Hi all, Thanks for all the feedback and apologies for the brief break in responses. I am currently 7 mos pregnant and ran into some health issues the last few weeks - feeling better now!
Update: I have temporarily disabled everything on the live site until I can get it all fixed. However, I think i'm getting close to a solution for using the Joomla 3 article images for og:image. it seems that this is the offending code:
Code: Select all
// Image
if ($this->params->get('image'.$suffix, '') != '') {
$document->setMetadata('og:image', JURI::base(false).htmlspecialchars($this->params->get('image'.$suffix, '')));
} else {
// Try to find image in article
$img = 0;
$fulltext = '';
if (isset($row->fulltext) && $row->fulltext != '') {
$fulltext = $row->fulltext;
}
$introtext = '';
if (isset($row->introtext) && $row->introtext != '') {
$fulltext = $row->introtext;
}
$content = $introtext . $fulltext;
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $content, $src);
if (isset($src[1]) && $src[1] != '') {
$document->setMetadata('og:image', JURI::base(false).htmlspecialchars($src[1]));
$img = 1;
}
I am NOT experienced with PHP but it looks like it's searching the fulltext and introtext fields in the d/b for any img tags. however, j3 stores its introtext and fulltext images in the field called images instead. so it looks like we need to redirect where it's searching. and then adjust the pattern it's trying to match because j3 doesn't store the images with usual html tags. and that's where i got stuck. does anyone know the correct syntax for the preg_match search string? j3 stores it's files in this format: "image_intro":"images\/articles\/netflix\/netflix-cover.png"
Thanks!
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 25 May 2014, 19:54
by xaashley
@miningmedia, thanks for the tip - I had actually just figured this out as well!
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 28 Jul 2014, 01:12
by ne0h
Hi all,
is there already a solution to the problem that the provided opengraph meta tags of the phoca opengraph plugin will show as meta content="example" name="example" instead of meta content="example" property="example"? Because of this issue facebook does not regognize the meta tags inserted by the phoca opengraph plugin for example the inserted App ID is not recognized because it uses name="fb:app_id instead of property="fb:app_id.
If there is a solution to the problem could you please provide me with a detailed explanation how to resolve this issue?
Thank you in advance.
ne0h
Re: Facebook Debugger Does Not See Phoca Open Graph Tags At
Posted: 30 Jul 2014, 23:09
by Jan
Hi, meta tags are set by Joomla! methods, so Phoca module only sends the information to Joomla! methods and they will output it - so in fact this should be a question on Joomla! developers.
For now the methods in this file need to be customized:
libraries\joomla\document\document.php
libraries\joomla\document\html\renderer\head.php
Jan