Page 1 of 1

Phoca Open Graph: wrong category name and image

Posted: 11 Oct 2023, 09:34
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!

Re: Phoca Open Graph: wrong category name and image

Posted: 12 Oct 2023, 00:47
by Jan
Hi, see how the image is handled:
https://www.phoca.cz/documentation/90-p ... open-graph

Jan

Re: Phoca Open Graph: wrong category name and image

Posted: 12 Oct 2023, 10:23
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...

Re: Phoca Open Graph: wrong category name and image

Posted: 12 Oct 2023, 21:36
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

Re: Phoca Open Graph: wrong category name and image

Posted: 12 Oct 2023, 21:44
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">

Re: Phoca Open Graph: wrong category name and image

Posted: 12 Oct 2023, 23:28
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

Re: Phoca Open Graph: wrong category name and image

Posted: 13 Oct 2023, 08:41
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?

Re: Phoca Open Graph: wrong category name and image

Posted: 18 Oct 2023, 23:48
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

Re: Phoca Open Graph: wrong category name and image

Posted: 19 Oct 2023, 08:41
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

Re: Phoca Open Graph: wrong category name and image

Posted: 20 Oct 2023, 16:14
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