Forums

How to modify page metadata?

Hardyman 02 Mar, 2015
I'm having trouble adding metadata to my Chronoform page. I am using a menu item to link to the form, but the default site description and keywords are displayed on frontend and not the custom ones used on the menu item.

How can I customize the keywords and description for the page?
fasenderos 03 Mar, 2015
1 Likes
Hi hardyman,
You have two options:
1) Use Meta Tagger action in Joomla Group by dragging a copy into your form On Load event

2)If you want to use the meta tag of the menu item put this code in a Custom Code action on your form On Load event

<?php
$menu = JFactory::getApplication()->getMenu()->getActive();
$doc = JFactory::getDocument();

$doc->setMetaData('keywords', $menu->params->get('menu-meta_keywords'));
$doc->setDescription($menu->params->get('menu-meta_description'));
?>

fax
This topic is locked and no more replies can be posted.