Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve menu item id if the url rewriting is enabled in joomla 3

Tags:

joomla3.0

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.

like image 385
Rishabh awasthi Avatar asked Dec 14 '25 06:12

Rishabh awasthi


1 Answers

To get all variable

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

To get the active menu

$app = JFactory::getApplication();
$menu = $app->getMenu()->getActive()->id;
echo $menu;
like image 156
user1672131 Avatar answered Dec 16 '25 21:12

user1672131



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!