3

Can anyone let me know that if the url rewriting is enabled in joomla and the url getting generated are seo friendly url's then in this case can I get menu item id if yes then what are the steps to get it.

for example my seo friendly url is www.example.com/store

I want to get menu item id from this url.

0

3 Answers 3

4

To get all variable

 $Itemid = JRequest::getVar('Itemid');

To get the active menu

$app = JFactory::getApplication();
$menu = $app->getMenu()->getActive()->id;
echo $menu;
3

JRequest is depricated in Joomla 3. So you should use the following instead:

$jinput = JFactory::getApplication()->input;
$Itemid = $jinput->getInt('Itemid');
0

Easiest method: $menu =& JSite::getMenu(); $Itemid = $menu->getActive()->id;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.