What does this do?
Menu Manager is a module for abstracting menus into a system that's easily usable and customizable. It abstracts the display portion of menus into smarty templates that can be easily modified to suit the user's needs. That is, the menu manager itself is just an engine that feeds the template. By customizing templates, or make your own ones, you can create virtually any menu you can think of.
How do I use it?
Just insert the tag into your template/page like: {menu}. The parameters that it can accept are listed below.
Why do I care about templates?
Menu Manager uses templates for display logic. It comes with three default templates called cssmenu.tpl, minimal_menu.tpl and simple_navigation.tpl. They all basically create a simple unordered list of pages, using different classes and ID's for styling with CSS.
Note that you style the look of the menus with CSS. Stylesheets are not included with Menu Manager, but must be attached to the page template separately. For the cssmenu.tpl template to work in IE you must also insert a link to the JavaScript in the head section of the page template, which is necessary for the hover effect to work in IE.
If you would like to make a specialized version of a template, you can easily import into the database and then edit it directly inside the CMSMS admin. To do this:
- Click on the Menu Manager admin.
- Click on the File Templates tab, and click the Import Template to Database button next to i.e. simple_navigation.tpl.
- Give the template copy a name. We'll call it "Test Template".
- You should now see the "Test Template" in your list of Database Templates.
Now you can easily modify the template to your needs for this site. Put in classes, id's and other tags so that the formatting is exactly what you want. Now, you can insert it into your site with {menu template='Test Template'}. Note that the .tpl extension must be included if a file template is used.
The parameters for the \$node object used in the template are as follows:
- \$node->id -- Content ID
- \$node->url -- URL of the Content
- \$node->accesskey -- Access Key, if defined
- \$node->tabindex -- Tab Index, if defined
- \$node->titleattribute -- Description or Title Attribute (title), if defined
- \$node->hierarchy -- Hierarchy position, (e.g. 1.3.3)
- \$node->depth -- Depth (level) of this node in the current menu
- \$node->prevdepth -- Depth (level) of the node that was right before this one
- \$node->haschildren -- Returns true if this node has child nodes to be displayed
- \$node->menutext -- Menu Text
- \$node->raw_menutext -- Menu Text without having html entities converted
- \$node->alias -- Page alias
- \$node->extra1 -- Applicable only when the loadprops parameter is supplied on the menu tag, this field contains the value of the extra1 page property.
- \$node->extra2 -- Applicable only when the loadprops parameter is supplied on the menu tag, this field contains the value of the extra2 page property.
- \$node->extra3 -- Applicable only when the loadprops parameter is supplied on the menu tag, this field contains the value of the extra3 page property.
- \$node->image -- Applicable only when the loadprops parameter is supplied on the menu tag, this field contains the value of the image page property (if non empty)
- \$node->thumbnail -- Applicable only when the loadprops parameter is supplied on the menu tag, this field contains the value of the thumbnail page property (if non empty)
- \$node->target -- Applicable only when the loadprops parameter is supplied in the menu tag, this field contains Target for the link. Will be empty if content does not set it.
- \$node->created -- Item creation date
- \$node->modified -- Item modified date
- \$node->index -- Count of this node in the whole menu
- \$node->parent -- True if this node is a parent of the currently selected page
EOF;
$lang['importtemplate'] = 'Import Template to Database';
$lang['menumanager'] = 'Menu Manager';
$lang['newtemplate'] = 'New Template Name';
$lang['nocontent'] = 'No content given';
$lang['notemplatefiles'] = 'No file templates in %s';
$lang['notemplatename'] = 'No template name given.';
$lang['templatecontent'] = 'Template Content';
$lang['templatenameexists'] = 'A template with this name already exists';
?>