When you need to get your active menu item ID in Joomla to display some specific content for only that menu item or just to show the ID of the menu item, you'll need to edit your index.php file in your templates folder (or use a third party plugin to add a PHP module somewhere in your site) and insert the following code where you wish to display the active menu item ID:
And to display something only when your desired menu item is clicked (active), you can use:
I used this last piece of code to add a http header refresh to a Joomla page so that when one certain menu item is clicked, the user automatically gets redirected after a period of time to another page. The code below needed to be inserted inside index.php <head></head> section:
Comments
Are you running an older version of Joomla? Because that's where I have tested it only and it works. Not sure if it'll work as expected on 2.5.
d.pr/i/yOQZ
I tried to insert it to other positions too, I am a little clueless why it won´t show me the message...
Help would be grately appreciated...! Thanks karlina
I have tried this, but it won´t echo me the message, what could there be wrong?
If I want to show the message in the content area w3 I thought i post it here?:
I tried to insert it to other positions too, I am a little clueless why it won´t show me the message...
Help would be grately appreciated...! Thanks karlina
RSS feed for comments to this post