Page 1 of 1
Phoca Open Graph - meta property instead meta name
Posted: 20 Sep 2014, 23:39
by lukasz
Hello,
now Phoca Open Graph adds tags like this:
Code: Select all
<meta name="og:title" content="Test"/>
This is not entirely correct.
Validator w3.org treats it as an error:
Bad value og:title for attribute name on element meta: Keyword og:title is not registered.
To check it yourself, you can type this code to
validator:
Code: Select all
<!DOCTYPE html><head><meta name="og:title" content="Test"/><title>Test</title></head>
Facebook recommend to use the meta property, too.
I suggest you change the meta name to meta property like this:
Code: Select all
<meta property="og:title" content="Test"/>
Thank you for looking at the issue.
Re: Phoca Open Graph - meta property instead meta name
Posted: 21 Sep 2014, 17:58
by Jan
Hi, see similar posts in this forum, Phoca Open Graph module does not decide which form will be used, all this depends on Joomla! and its methods:
Code: Select all
$document->setMetadata('og:title', htmlspecialchars($thisTitle));
So this is more a question on Joomla! developers
but not sure if it is good to limit your site and decrease your website SEO because of some rules which do not reflect newest features of browsers and different web services
Jan
Re: Phoca Open Graph - meta property instead meta name
Posted: 21 Sep 2014, 18:27
by lukasz
Re: Phoca Open Graph - meta property instead meta name
Posted: 23 Sep 2014, 00:16
by Jan
Hi, thank you for the info, added to feature request list.
Jan
Re: Phoca Open Graph - meta property instead meta name
Posted: 21 Jan 2015, 07:57
by baschwar
Any updates on this issue? Without correcting this issue it makes this plugin useless.
Jan wrote:Hi, thank you for the info, added to feature request list.
Jan
Re: Phoca Open Graph - meta property instead meta name
Posted: 23 Jan 2015, 00:34
by Jan
Hi, sorry I don't understand, validator outputs do not have any influence on functionality of the site. Sometimes, following the validator rules you can limit your site and your SEO (as validators do not accept specific browsers features and new features, so when you will limit your site, your SEO will decrease
- of course I don't say, that you should break standard html or css rules - see more information about this in similar posts in this forum )
Anyway, did you ask on joomla.org forum or Joomla! developers why the use "name" instead of "property" and if they will change it?
It is still in features request list, so if there will be no changes in Joomla!, I will try to do it per some "specific/hack" solution but it is always better to make it proper way, because making non standard method can be a problem in feature
Jan
Re: Phoca Open Graph - meta property instead meta name
Posted: 10 Jun 2015, 00:41
by Hayward
Joomla's $document->setMetadata is working as intended - it is for <meta name="something" />
You have to use $document->addCustomTag to use the proper <meta property="something" /> for the Open Graph meta.
Example:
For og:title, find this (in /plugins/content/phocaopengraph/phocaopengraph.php):
Code: Select all
$document->setMetadata('og:type', $this->params->get('type'.$suffix, 'article'));
and replace it with this:
Code: Select all
$document->addCustomTag('<meta property="og:type" content="' . ($this->params->get('type'.$suffix, 'article')) . '" />');
You need to replace all the setMetadata with addCustomTag for anything that uses meta property instead of meta name (full list
here).
Re: Phoca Open Graph - meta property instead meta name
Posted: 10 Jun 2015, 22:36
by Jan
Hi, of course, you need not to use Joomla! setMetadata but you need not to to use addCustomTag either and you can write it directly to template more easier way, the problem of addCustomTag is you need to write in fact whole complicated code so maybe then it is more easier to write it directly to template code.
But anyway thank you for the info, it can be set as alternative - did you test that it is set to right place in html source code?
Jan
Re: Phoca Open Graph - meta property instead meta name
Posted: 12 Jun 2015, 13:50
by Jan