Open Graph site description x article description

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
ChrisCross
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 07 Feb 2016, 19:34

Open Graph site description x article description

Post by ChrisCross »

Hi,

I've noticed that if I add a site description and title to the settings, it overrides the article description and only shows the site title/description instead of both.

Is that the normal behaviour? I was expecting it to populate the article title and description from the article and add the site description and title from the static.

Thanks,

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

Re: Open Graph site description x article description

Post by Jan »

Hi,

this way the description works:

Code: Select all

// Description
		if ($this->params->get('description'.$suffix, '') != '') {
			plgContentPhocaOpenGraphHelper::renderTag('og:description', $this->params->get('description'.$suffix, ''), $type);
		} else if (isset($thisDesc) && $thisDesc != '') {
			plgContentPhocaOpenGraphHelper::renderTag('og:description', $thisDesc, $type);
		} else if ($config->get('MetaDesc') != '') {
			plgContentPhocaOpenGraphHelper::renderTag('og:description', $config->get('MetaDesc'), $type);
		} else if (isset($row->introtext) && $row->introtext != '' && $desc_intro == 1) {
			$iTD = str_replace("\r\n", ' ', strip_tags($row->introtext));
			$iTD = str_replace("\n", ' ', $iTD);
			$iTD = str_replace("\n", ' ', $iTD);
			plgContentPhocaOpenGraphHelper::renderTag('og:description', $iTD, $type);
		}
There is a description rule, if it is not the case then it always comes to next rule:

-> description from the parameter
-> description from meta tags
-> description from Joomla! meta tag
-> description from text directly

To get other output, you need to customize the code directly to fit your needs. To move different rules each other.

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