PHP
Joomla! 6
Joomla! 5
Joomla! 3 (Legacy)
Template
Basic
Access Parameters of the Active Menu Item
Retrieves the active MenuItem via $app->getMenu()->getActive() and reads any parameter with getParams().
templates/seu_template/index.php
<?php
declare(strict_types=1);
use Joomla\CMS\Factory;
$active = Factory::getApplication()->getMenu()->getActive();
$yourParameter = $active ? $active->getParams()->get('yourParameter', '') : '';
Uses official getParams() with PHP 8 null-safe handling.
templates/seu_template/index.php
<?php
$app = JFactory::getApplication();
$currentMenuItem = $app->getMenu()->getActive();
$params = $currentMenuItem->params;
$yourParameter = $params->get('yourParameter');
Legacy Joomla 3 access via $currentMenuItem->params.
Technical explanation and best practices
In Joomla 5 and 6, read menu item parameters using $active->getParams() instead of the deprecated public $params property, always guarding against null on 404 or menu-less routes.