Open Graph plugin uses wrong url

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 28 Nov 2017, 10:55

Open Graph plugin uses wrong url

Post by bekh6ex » 28 Nov 2017, 11:06

I've noticed an issue with og:url. (At least I think it is an issue)

As you know, in Joomla, if you have an article with ID=2, you can open it with url "/article/2-some-alias" or "/something/else/2-what-ever". Both URLs lead to the same content.
Currenlty, Open Graph Plugin will put two different URLs in "og:url" in this case, but semantically, I believe, "og:ulr" should be the same in both cases as soon as the content is the same.
This becomes a problem if you, for example, add Facebook comment widget tho the page. Widget will treat these articles as different (this is what I got from documentation, didn't check yet), and there will be two different comment lists.

If you think that current behavior is correct, I would suggest to at least add a plugin setting. That would work for me.

Anyway, thanks for the plugin - it does it's job! :)

User avatar
Phoca Hero
Phoca Hero
Posts: 43010
Joined: 10 Nov 2007, 18:23
Location: Czech Republic

Re: Open Graph plugin uses wrong url

Post by Jan » 30 Nov 2017, 20:31

Hi, the url is taken from current page:

Code: Select all

$uri 	= JFactory::getURI();
$this->renderTag('og:url', $uri->toString(), $type);
So the plugin does not create any specific URL it just get the one where the article is located :idea:

If you find Phoca extensions useful, please support the project

Post Reply