Open Graph plugin uses wrong url

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

Open Graph plugin uses wrong url

Post by bekh6ex »

Hi.
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
Jan
Phoca Hero
Phoca Hero
Posts: 47865
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph plugin uses wrong url

Post by Jan »

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:

Jan
If you find Phoca extensions useful, please support the project
Post Reply