phoca open graph

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
exigo
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 20 Sep 2017, 11:30

Phoca open graph litlle description problem

Post by exigo »

Hello Jan!

I too have a problem with open graph plugin.
So, I read all doc, I think I understand it that.
Configure the plugin, I checked Fb debugger sharing works fine.
Only one thing not working the description option.
I use menu point metadata option, I use it metakey, and description too.
I look at the source, and the default meta name description row is ok, but the meta property="og:description" use it the global description and not the menu point metadata.
I tried all option in the plugin setup, not change.
So I install the system plugin and now working fine, but now have 2 row meta property="og:description".
The first is a bad row, when use it the global meta, 2. use it my option from menupoint metadata.

I hope understand my problem...

What I will do it now? :)
Thanks!

Joomla! 3.9.12
PHP 7.3.10
10.1.41-MariaDB-cll-lve
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: phoca open graph

Post by Jan »

Hi,

both plugins are different regarding the description:

- System plugin just uses document description
- Content plugin uses this flow: https://www.phoca.cz/documents/70-phoca ... open-graph

So the content is following:

Code: Select all

// Description

		if ($this->params->get('description'.$suffix, '') != '') { // description in params
			$this->renderTag('og:description', $this->params->get('description'.$suffix, ''), $type);
		} else if (isset($thisDesc) && $thisDesc != '') { // article meta description
			$this->renderTag('og:description', $thisDesc, $type);
		} else if ($this->params->get('menu-meta_description') != '') { // menu link meta description
			$this->renderTag('og:description', $this->params->get('menu-meta_description'), $type);
If there is no description in parameters and in article meta description, the menu link description should be displayed. :idea: Are you sure both 1) and 2) are empty?

Jan
If you find Phoca extensions useful, please support the project
mgallard
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 10 Jan 2020, 05:26

Re: phoca open graph

Post by mgallard »

A specific issue:

I am using smartslider on many of my site's pages, so the description sometimes appears thus:

<meta property="og:description" content="smartslider3[29] Puerto Vallarta está ubicado en la Costa Dorada de México, en el punto medio de norte a sur en la Bahía Banderas, donde el Océano Pac...">

Is there a way to configure the descriptions so Phoca removes all "smartslider3[*]" found in them?

Thanks a lot,

M.G.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: phoca open graph

Post by Jan »

Hi, the only way I can imagine now, is to make the modify of the plugin directly in the code and set there some preg_replace function which will remove this or similar text from the description :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
Kostelano
Phoca Member
Phoca Member
Posts: 45
Joined: 23 May 2019, 20:47

Re: phoca open graph

Post by Kostelano »

Good afternoon!
I started using the plugin and I have a question - how to understand this parameter:

Code: Select all

Remove Strings (Description)
Remove strings from description in case Intro Text is set as description. Separate each value with comma (,).
I don’t understand how to use it and what to enter. :(

Thanks!
User avatar
Kostelano
Phoca Member
Phoca Member
Posts: 45
Joined: 23 May 2019, 20:47

Re: phoca open graph

Post by Kostelano »

Good evening!
Phoca Open Graph System Plugin in conjunction with OSMap causes a sitemap error for XML pages:

Code: Select all

Call to undefined method Joomla\CMS\Document\XmlDocument::addCustomTag()
This problem is solved by excluding com_osmap in the plugin settings, but for obvious reasons, the OPEN GRAPH markup for the HTML page is also lost.

Perhaps in the future you will find a separate solution for the problem with XML.
Thanks!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: phoca open graph

Post by Jan »

If you find Phoca extensions useful, please support the project
User avatar
Kostelano
Phoca Member
Phoca Member
Posts: 45
Joined: 23 May 2019, 20:47

Re: phoca open graph

Post by Kostelano »

Hello! Thanks.

I read the information on the page that you gave.
The fact is that I use the system plugin (Phoca), I don’t have a content plugin at all.
And by the way, the OSmap Free version is also the latest :).
The issue is resolved for the Phoca content plugin, but is NOT resolved for the system one.

Update.
Is it possible to implement a check in which metadata will be used for a page in HTML and, accordingly, the plugin will be turned off for pages in XML?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: phoca open graph

Post by Jan »

Hi, try to open this file:

plugins\system\phocaopengraph\phocaopengraph.php

and on line cca. 75 change FROM:

Code: Select all

if ($docType == 'pdf' || $docType == 'raw' || $docType == 'json') {
			return;
		}
TO:

Code: Select all

if ($docType == 'pdf' || $docType == 'raw' || $docType == 'json' || $docType == 'xml') {
			return;
		}
and let me know if it works.
If you find Phoca extensions useful, please support the project
User avatar
Kostelano
Phoca Member
Phoca Member
Posts: 45
Joined: 23 May 2019, 20:47

Re: phoca open graph

Post by Kostelano »

Jan
Thanks a lot, it works!
Post Reply