+

Search Tips   |   Advanced Search

Menu styles


We can vary the appearance of the items in menus that are delivered through the JSON menu framework.

The appearance of the items in the menus that are rendered by the JSON menu framework are determined by style names that appear on the rendered markup for the menu items. These styles are defined in Cascading Style Sheet (CSS) file that are part of the theme. The default theme has these style sheets in WebDAV in the themes/Portal8.0/css directory.

There are two ways that the appearance of the menu items can be changed.

The first method keeps the same style names on the menu items, but redefine what appearance results from that style. When creating your custom theme, take copies of the existing default theme css files as samples and alter them as necessary to achieve the appearance you want.

For the second approach, the JSON menu definition syntax allows the specification of a style name on the menu items, including headers and separators, using the itemClass member in a menu item definition. By adding explicit entries for the style names on the menu items, those overriding style names are used in the resulting menu markup. The itemClass member is only useful on menu items of type StaticMenuItem, DynamicMenuItem, Header, Separator, and SubMenu. Note that on a SubMenu, the style is applied only to the SubMenu entry anchor link itself, and not to the menu items that actually make uthat SubMenu.

These CSS files define the menus.


Default menu styles


Style class definitions

The context menu JavaScript is in dav:fs-type1/themes/Portal8.0/js/contextmenu.js.

The wptheme.contextmenu.css JSON object defines constanto used to apply CSS classes. The constants are by default set to:

contextMenu: {
...
css: {
disabled: "wpthemeMenuDisabled", show: "wpthemeMenuShow", error: "wpthemeMenuError", menuTemplate: "wpthemeTemplateMenu", submenuTemplate: "wpthemeTemplateSubmenu", loadingTemplate: "wpthemeTemplateLoading"
}, ....
}


Parent: Menu framework
Related:
Styles