Monthly archives: October 2006Entries found: 1
How to ensure your module is loaded even if it means creating phantom menu items:
I debugged a VirtueMart site today in which some of the modules were not loading as expected. The problem turned out to be inaccurate menu items. That problem was not evident because the menu items were never actually used. They existed just to support the modules, not as navigation.
Here is a step by step on how to support modules that don’t have navigation menus.
Given a web site section full of static items, the items might have internal content links among themselves with no outer navigation structure. If a module loads those static content items it must do so through a menu item. But within the context of one static piece pointing to another, the content might just use internal links.
The problem arises because all of the other modules on the page know whether to load or not based on an association with a menu item. Those internal static pages didn’t have menu items associated with them. Therefore when the static pages loaded they landed on a blank pages with no other modules present.
To fix this scenario I created a phantom menu that was marked “published” but which loaded into a non-existent module area. The steps to fix the issue are as follows:
In the menu manager, create a new menu (StaticMenu)
Within that menu, create a new Link to Static Content
Choose the static content and give the menu item a name
After saving that menu item you will get the address of that item in the menu item editor, for example:
Throughout the static content, whenever you want to refer to that item, use the index.php address just discovered.
Repeat for each static item.
Go to the site modules menu. Ensure that the StaticMenu is published but is assigned to a module area that the template doesn’t use.