As per title, is there already an event that can work like a sort of
I need to change some meta tags in the
title, and so on.
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It only takes a minute to sign up.Sign up to join this community
I have to edit my answer, as I think I didn't get right what you are actually want initially.
With all the 3 events you can do changes on the head. If you have other plugins that do the same, then you can re-order them.
The head is stored in the document object and you can access it and manipulate it easily:
$doc = JFactory::getDocument(); $doc->setTitle('My Title'); $doc->setMetaData( 'tagname', 'tag content' ); $doc->addCustomTag( '<!-- this is a comment -->');
$doc->setMetaData( 'description', 'My Description' ); $doc->addCustomTag( '<meta property="og:title" content="Custom og Title tag">');
You can also get the full head data with :
$head = $doc->getHeadData(); // echo '<pre>' . print_r($head, true) . '</pre>';
$head is the array of data destined for the
HTML <head> section in array form.
This only returns the data added by the set Methods of the JDoc. It will not return data about files that have been linked directly from html in the template head.
You can then set data to the
$head['metaTags']['standard']['keywords'] = 'keyword1, keyword2,...'; $doc->setHeadData($head);