Phoca Open Graph: wrong category name and image

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
jabba
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 09 Dec 2014, 11:30

Phoca Open Graph: wrong category name and image

Post by jabba »

Hello, i've installed Phoca Open graph plugin and it works fine with joomla articles, but i have some issues with category blog view. Here are some screenshots:

Plugin options: https://www.pixed.it/att/plugin_options.JPG
Category options: https://www.pixed.it/att/category.JPG
Meta: https://www.pixed.it/att/meta.JPG

This is the link of the page: https://www.accaparlante.it/progetto-calamaio
It seems that the values are taken from a subcategory.

Any help?
Thanks!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Open Graph: wrong category name and image

Post by Jan »

Hi, see how the image is handled:
https://www.phoca.cz/documentation/90-p ... open-graph

Jan
If you find Phoca extensions useful, please support the project
jabba
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 09 Dec 2014, 11:30

Re: Phoca Open Graph: wrong category name and image

Post by jabba »

Hi and thanks for the reply. I've read that and i think my configuration is ok.

The menu is a category blog view: "index.php?option=com_content&view=category&layout=blog&id=XX"

and the category itself has an image set in the options tab:

"images/calamaio/calamaio1.jpg#joomlaImage://local-images/calamaio/calamaio1.jpg?width=800&height=531"

maybe the problem is the #string added by joomla by default?

Apart from the image, also the "<meta property="og:title" content="Laboratori interni">" is wrong, the value is taken from the third subcategory of the page...
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Open Graph: wrong category name and image

Post by Jan »

Hi, there is no problem with the suffix. Such is cleaned in the code. But the problem could be in options. Check the option "Display Category Image in Article" - if this is set to No, then the category image is not set for the meta tags.

Image

Jan
If you find Phoca extensions useful, please support the project
jabba
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 09 Dec 2014, 11:30

Re: Phoca Open Graph: wrong category name and image

Post by jabba »

Hi Jan, thanks again.
I've set it to "yes" but the problem persists: https://www.accaparlante.it/progetto-calamaio
I got the name and the image of the 3d subcategory:

Code: Select all

<meta property="og:title" content="Laboratori interni">
<meta property="og:type" content="article">
<meta property="og:image" itemprop="image" content="https://www.accaparlante.it/images/calamaio/Labo%20viaggio.jpg">
<meta property="og:url" content="https://www.accaparlante.it/progetto-calamaio">
<meta property="og:site_name" content="Centro Documentazione Handicap - Cooperativa Accaparlante">
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Open Graph: wrong category name and image

Post by Jan »

Do you use some module which display articles or categories? If yes, try to disable it (for test), to know, if the sucategory is not rendered as first e.g. by some module?

Jan
If you find Phoca extensions useful, please support the project
jabba
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 09 Dec 2014, 11:30

Re: Phoca Open Graph: wrong category name and image

Post by jabba »

No modules loaded, it's a blog page created with yootheme builder.
Odd thing is that any other category pages are ok (https://www.accaparlante.it/progetto-ca ... o-a-scuola , https://www.accaparlante.it/progetti/progetti-in-corso , etc..)
Only this one is wrong: the only difference is that this category has no own articles and only subcategories. Can this lead to any issues?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Open Graph: wrong category name and image

Post by Jan »

Hi, maybe, the open graph tries to find the first article in the category, so when there is none, there are no data for the open graph. :idea:

Jan
If you find Phoca extensions useful, please support the project
jabba
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 09 Dec 2014, 11:30

Re: Phoca Open Graph: wrong category name and image

Post by jabba »

Thanks for the reply. Did try to add an article but it is ignored... it just goes to fetch data from the subcategory...
No other options for now.
Do you know in the code where i can force the data? Just adding a PHP "if" on the URL to force the meta elements
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Open Graph: wrong category name and image

Post by Jan »

Hi, the code is only in one file:
plugins/content/phocaopengraph/phocaopengraph.php

But the question is, if you get such information from article? If not, then you have nothing to add there :-(

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