Open Graph on multilingual site not working for English only.

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
slashdottom
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Oct 2016, 22:07

Open Graph on multilingual site not working for English only.

Post by slashdottom »

Hi,

I have a multilingual Joomla 3.6.2 site with the latest OpenGraph Plugin installed. The menu and pages are the same structure for each language, essentially its just a translation of the original English menus and pages.

Here's the problem;
The plugin seems to work fine with all language pages except the English pages that come from menu with sub-menus in them, and I can't see why. I'll try to make things clearer, a menu with no sub-menus in it will show a page that has the OG meta tags, however any pages from a menu that has sub-menus in them does not contain and OG meta tags. The exception to this is that Blog Categories pages do display the OG meta tags.

Example;
[ Menu 1 ] [ Menu 2 ]
[ Sub-Menu 2 A ]
[ Sub-Menu 2 B ]
[ Sub-Menu 2 C Blog ]

From [ Menu 1 ] with no sub-menus displays the page with OG tags.
From [ Menu 2 ], [ Sub-Menu 2 A ], [ Sub-Menu 2 B ] the pages have no OG tags.
From [ Sub-Menu 2 C Blog ] the pages display the OG tags.

This is really confusing and I can't see why this is happening and is only with English, the other 4 languages seem to be fine.

Please can someone help me on this?

Thanks,
Tommy.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph on multilingual site not working for English only.

Post by Jan »

Hi, hmm, which is the type of [ Sub-Menu 2 B ]?

The information are displayed in article or blog (list of articles), on other types, system plugin can be used: https://www.phoca.cz/phoca-open-graph-system-plugin (which is of course limited in the options of information)

Jan
If you find Phoca extensions useful, please support the project
slashdottom
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Oct 2016, 22:07

Re: Open Graph on multilingual site not working for English only.

Post by slashdottom »

Hi Jan,

[ Sub-Menu 2 B ] is an Articles » Category Blog

The site is pretty much made up of the following; mostly Articles » Single Article, Articles » Category Blog, and a Gallery page (also affected)

After doing more investigation;

Most menu items point to a Single Article (type: Articles » Single Article). In English they don't have OpenGraph tags, but in all the associated language pages they do have the OpenGraph tags.

Most Category Blog menu items (type: Articles » Category Blog) do not display the OpenGraph tags on that page (apart from one), however the articles that are selectable from the Category Blog page do have the OpenGraph tags, again this only applies to English, all other languages seem to work fine)

So it is strange that this only appears to affect English, which was the first language / content added.

What is also strange is that if I create new identical content and same settings as something currently not working, under the above conditions the OpenGraph tags then appear on that page.

I've compared both Menu Items, Articles, Categories, but I just can't see why its not working.

Tommy.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph on multilingual site not working for English only.

Post by Jan »

Hmmm, really no idea what can be wrong there. When you e.g. add some other content plugin the the article, is this plugin displayed?

Jan
If you find Phoca extensions useful, please support the project
slashdottom
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Oct 2016, 22:07

Re: Open Graph on multilingual site not working for English only.

Post by slashdottom »

I just tried the Instant PayPal plugin on the English home page, it displayed okay but the Open Graph tags are still missing.
slashdottom
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Oct 2016, 22:07

Re: Open Graph on multilingual site not working for English only.

Post by slashdottom »

Doing some process of elimination, the problem appears to be linked to the menus, not to the articles, categories, menu modules, or languages installed, or anything else I tried.

I can recreate an English menu item exactly the same as one causing a problem with the Open Graph tags, it works perfectly for that page.

So I really don't want to go through recreating all the exact same English menu structure.

For reference, the only English language installed is the default en-GB.

Jan, with this additional information, is there anything else I can try or look into?

I'm thinking what if I were to go to all the effort of recreating the English menus only to find a similar problem later.

Tommy.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph on multilingual site not working for English only.

Post by Jan »

Are you familiar to PHP somehow?

I think, the only possibility is to somehow debug the content plugin and print e.g. some debug info, whether it is active or not

E.g.
plugins/content/phocaopengraph/phocaopengraph.php

FROM:

Code: Select all

public function onContentAfterDisplay($context, &$row, &$params, $page=0) {
		
		$app 	= JFactory::getApplication();
TO:

Code: Select all

public function onContentAfterDisplay($context, &$row, &$params, $page=0) {
		print_r($context);
		print_r($row);
		exit;
		$app 	= JFactory::getApplication();
To see if something will be printed on the screen - whether the plugin is active or not in English article :idea:

Jan
If you find Phoca extensions useful, please support the project
slashdottom
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Oct 2016, 22:07

Re: Open Graph on multilingual site not working for English only.

Post by slashdottom »

Okay, I will try just now.
slashdottom
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Oct 2016, 22:07

Re: Open Graph on multilingual site not working for English only.

Post by slashdottom »

Hi Jan,

I did the suggest PHP edit and then compared the source code of the English page against an associated language page, didn't see anything different other than language content. Actually didn't see any references to Open Graph in both English or other language page and the complete html head section was missing from both, also the menus didn't display for both.

I should have also said, I'm using a Yootheme / Warp7 template.

Tom.
slashdottom
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 06 Oct 2016, 22:07

Re: Open Graph on multilingual site not working for English only.

Post by slashdottom »

Jan,

Is it possible for me (or you) to contact this board member FuZZball who last year seems to have the same or similar problem as me. I see their website continues to have the same template but the Open Graph stuff seems to be working.

ref;
viewtopic.php?t=37798
https://yootheme.com/support/question/89344

Thanks,
Tommy.
Post Reply