register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'meta_keywords', array()); } /** * Add a key words description * @param $event * @param $param * @throws ExceptionNotFound */ function meta_keywords(&$event, $param) { try { $page = action_plugin_combo_metacanonical::getContextPageForHeadHtmlMeta(); } catch (ExceptionNotFound $e) { return; } try { $keywords = $page->getKeywordsOrDefault(); } catch (ExceptionNotFound $e) { return; } Metadata::upsertMetaOnUniqueAttribute( $event->data['meta'], "name", [ "name" => PageKeywords::PROPERTY_NAME, "content" => implode(",", $keywords) ] ); } }