/ Published in: PHP

It's not possible to use the standard syntax to retrieve the current id of the Joomla module in a Joomla xml element. This code parses the url and grabs the last part of the url which i atypically the module id when editing a module in the Joomla admin.
We used this to create a unique cookie for each instance of the module.
We used this to create a unique cookie for each instance of the module.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Workaround to get the module id via the url. $moduleID = JUri::getInstance()->toString(); // Split the url instance so we can get the moduel id // The fourth = last variable in the module admin so we set the cookie name to that $cookieName = "listOrder".$moduleID[4];
Comments
