Joomla MainMenu Caching |
|
| Written by Rick Winkler | |
| Monday, 10 March 2008 | |
|
While testing, I encountered a weird issue with my template and the Main Menu at the top. When you hover over and item, the item background turns black. After you navigate to a section, Services for example, that section's menu item should continue to have a black background while you remain on that page. With my site, this was not working. Sometimes Home would always stay highlighted, sometimes it would shift to another item and stay there. When the hightlighting would get "stuck", it would remain that way no matter where you navigated to on my site. After several posts on the Joomla Forum, I found the culprit: Caching. Out of the box, Joomla 1.5 RC4's mainmenu module has its caching properties set "Use Global." When caching is globally enabled, the query results for the mainmenu would be cached from the frontpage (Home) and subsequent queries would be delivered from this cache. The results of the query which returned Home having id=”current” would be used repeatedly. The highlighting on my site is based off of this tag. The fix was pretty simple. By navigating to Extensions > Module Manager in the Administrator panel for Joomla, we can override the cache settings for this module. Under Parameters in the properties of the module, select "Advanced Parameters" > Caching = No Caching. A simple fix for a simple problem! |
