How can I add (open graph) meta tags into code of the View Action?

anne1979 18 Jul, 2016
Hi to you all,

I want to add certain meta tags / open graph tags to the "head" section of the code output in my view-action of a connectivity listing. How can I do that? Those tags shall be filled with data coming from the dataset which is opened in the view-action.

Thank you in advance,
Anne
GreyHead 18 Jul, 2016
Hi Anne,

Can you use the MetaTagger action from the Joomla! actions group to do this in the form Event that you are using to display the record?

Bob
anne1979 18 Jul, 2016
Answer
Hi Bob,

well I don't know how to access that MetaTagger action from within my ChronoConnectivity listing, because I do not use a Chronoform for the display, just code in the Front list > Actions > view...
But I managed to add my custom code like so:


$exMeta = '<meta property="og:image" content="'.$mainImage.'"/>'."\n";
$exMeta .= '<meta property="og:description" content="'.$this->data['Fahrzeug']['description'].'"/>'."\n";
$jdoc->addCustomTag($exMeta);


And it works.

But thanks for providing your ideas😀
This topic is locked and no more replies can be posted.