Reputation: 3
I need to use javascript to get the itemid of the current page in Joomla. Is there a way to do this? The urls are sef so I cant just use the url...
Upvotes: 0
Views: 1028
Reputation: 8178
No mention of version, but I've used this in the past with the PHP. There's no direct javascript way, so you'll need to echo that into your script, or put it into a hidden form field, or some other mechanism.
$currentMenuId = JSite::getMenu()->getActive()->id ;
Upvotes: 1