Elxis CMS Forum

Support => General => Topic started by: armpouniotis on September 02, 2020, 12:23:25

Title: About facebook sharing (og:url, og:type, og:title, og:image, og:description, fb)
Post by: armpouniotis on September 02, 2020, 12:23:25
Hi there !

if we want to share an article on facebook,
do we have to put inside our index.php these attributes ???:

"og:url, og:type, og:title, og:image, og:description, fb:app_id"

facebook debuger says that: "Warnings That Should Be Fixed"

When I am trying to share an artile, I can see its title etc, but sometimes the image is from another article....

Any help ?


Thank you in advance

Christos Armpouniotis
Title: Re: About facebook sharing (og:url, og:type, og:title, og:image, og:description, fb)
Post by: webgift on September 03, 2020, 19:13:33
Hello,
the open graph (og) meta data must be added from com_content as we need
to fetch info from there like article's title, one image and a part of it's description.
og:url, og:type can be declared from template's index.php file as well as the
fb:appid.

The general syntax is:

<meta property=”og:type” content=”website” />

so you could use addCustom method in order to implement them like f.e:

eFactory::getDocument()->addCustom('<meta property="og:type" content="website" />');

in any case com_content must be adjusted.
Title: Re: About facebook sharing (og:url, og:type, og:title, og:image, og:description, fb)
Post by: armpouniotis on September 03, 2020, 23:18:12
Hi there !

thank you for your help !

As you say, com_content file should be modified in order to implement og:title, og:image, og:description.

I see your point.....

Thank you anyway !

Christos
Title: Re: About facebook sharing (og:url, og:type, og:title, og:image, og:description, fb)
Post by: datahell on September 04, 2020, 19:20:14
FYI: The latest Elxis release (5.1 rev2352) supports execution of content plugins without editor integration. This means that {blah}...{/blah} in editor is not required. So, you can develop a plugin that will add the meta tags you want (they way webgift mention or else) without touching Elxis source code and without even having to edit the articles in order to add the plugin ;-) To use as sample: A plugin that has uses this new Elxis feature is the Guests Comments (https://www.elxis.net/edc/public-opinion/158.html) plugin