Screenshot shows menu item parameters for Joomla - Content - Featured Articles Menu
Here are two code snippets inside Joomla that lets you access menu parameters anywhere inside Joomla!
$app = JFactory::getApplication(); // Get active menu $currentMenuItem = $app->getMenu()->getActive(); // Get params for active menu $params = $currentMenuItem->params; // Access param you want $yourParameter = $params->get('yourParameter');
$app = JFactory::getApplication(); // Get Itemid from URL $input = JFactory::getApplication()->input; $itemId = $input->get->get('Itemid', '0', 'INT'); // Get menu from Itemid $menuItem = $app->getMenu()->getItem($itemId); // Get params for menuItem $params = $menuItem->params; // Access param you want $yourParameter = $params->get('yourParameter');
That was easy-peasy! Wasnt it?
Feel free to add comments!
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.