Menubar

Menubar is a WordPress menu plugin that adds one or more configurable menus to your WordPress site. With Menubar you can create both single and multi-level menus, and you can style them with customizable menu templates.

This page contains the updated documentation for Menubar 5.0.

Contents

Features

With Menubar:

– You can build fully customized single or multi-level menus with the homepage, the frontpage, categories, category trees, static pages, page trees, tag archives, single posts, a search box, and any static or PHP generated URLs;

– You can add, edit and delete menus and menu items in the plugin user friendly settings page;

– You can specify where to place each menu by inserting in your theme a short line of PHP code; you can also use the included Menubar widget to place a menu in a sidebar or widget-ready area of your theme;

– You can choose one of the default menu templates to style each menu, and you can modify or rewrite the menu templates as you like; and you can move your modified templates into a different folder, so plugin upgrades won’t overwrite your changes.

[back to Contents]

First installation

After the standard plugin installation procedure, you’ll be able to access the plugin settings page Appearance -> Menubar and create your first menu.

If you plan to customize your Menubar templates, you can move them into a different folder, so they won’t be overwritten by the next plugin upgrade.

To move your templates:

1) Create a new folder named menubar-templates under wp-content/plugins;

2) Move everything that’s in wp-content/plugins/menubar/templates into the new menubar-templates folder.

The menubar-templates folder, if present, overrides the default templates folder.

[back to Contents]

Upgrading

Before running the standard plugin upgrading procedure, make sure you didn’t modify the default templates. If you did, you can move them into a different folder so they won’t be overwritten by the upgrade. To move the templates, see the instructions in the previous section.

[back to Contents]

In the Appearance – Menubar settings page you can create, edit, and delete menus. Menus are specified with the following fields:

* Name: the name of your menu; will be used to insert the menu in your theme.

* Template: the Menubar template and the stylesheet you wish to apply to this menu. You can also choose to apply a template without a stylesheet, and in this case you’ll have to provide your own CSS rules, e.g. in your theme style.css file. Please note that not all Menubar templates support multi-level menus.

Important: edit your theme inserting the following line of code where you wish to display your menu. If your menu name is mymenu, the line of code to insert in your theme is:

<?php do_action('wp_menubar','mymenu'); ?>

A good starting place to insert the above line of code could be at the end of the header.php file.

Another way to integrate your menu in your theme is to use the included Menubar widget, which allows you to add a menu in a sidebar or widget-ready area of your theme.

Before looking at your new menu, please add at least one menu item (see the next section).

[back to Contents]

In the Appearance – Menubar settings page you can add, edit, and delete menu items for each of your menus. Menu items are specified with the following fields:

* Order: indicates where this menu item will be placed. Choices are:

- Before…: this item will be placed right before the item you select.

- Child of…: this item will be placed as a sub-item of the item you select; please note that to display a multi-level menu you’ll need a multi-level Menubar template like Suckerfish.

- After…: this item will be placed right after the item you select.

You can later modify the ordering of your menu items using the Edit command or the up and down arrows in the menu items list.

* Name: specifies the name of this menu item as shown in the menu; for instance Home, About, News, Gallery, and so on.

* Type: specifies the menu item type. Each type may require additional fields, as shown below:

- type Home: this menu item points to your main blog page (the latest posts list).

- type FrontPage: this menu item points to your static front page, if configured in WordPress Settings – Reading, otherwise it’s the same as Home.

- type Heading: this menu item is non clickable, and could be used in a multi-level menu as the parent of a set of sub-items.

- type Tag: this menu item points to the tag archive specified in the Tag field.

- type TagList: this menu item generates a menu sub-item for each tag archive, excluding the tags specified in the Exclude field. Please note that, if you add sub-items to a TagList item, they will be ignored and won’t be displayed in your live menu.

- type Category: this menu item points to the category archive specified in the Category field.

- type CategoryTree: this menu item points to the category archive specified in the Category field, and automatically generates a menu sub-item for each sub-category, excluding the categories specified in the Exclude field, and up to the level specified in the Depth field. Any categories selected in the Headings field will be made non clickable. Please note that, if you add sub-items to a CategoryTree item, they will be ignored and won’t be displayed in your live menu.

- type Page: this menu item points to the static page specified in the Page field.

- type PageTree: this menu item points to the static page specified in the Page field, and automatically generates a menu sub-item for each sub-page, excluding the pages specified in the Exclude field, and up to the level specified in the Depth field. Any pages selected in the Headings field will be made non clickable. Please note that, if you add sub-items to a PageTree item, they will be ignored and won’t be displayed in your live menu.

- type Post: this menu item points to the single post page whose post ID is specified in the Post ID field.

- type SearchBox: this menu item displays a search box with an optional submit button whose text is specified in the Button field.

- type External: this menu item points to the static URL specified in the URL field.

- type PHP: this menu item runs the code specified in the PHP code field and gets the array returned by that code, then displays the label contained in its first element and points to the URL contained in its second element (see also The Menubar PHP type).

- type Custom: this menu item outputs the HTML specified in the HTML field – for experts only!

For each menu item you can also specify two optional fields:

* CSS class: the optional CSS class you wish to apply to this menu item (useful for customizations, see later); multiple classes can be entered, separated by spaces.

* Attributes: the optional HTML attributes you wish to apply to your menu item (e.g. target=”_blank”, or title=”click me!”); multiple attributes can be entered, separated by spaces.

[back to Contents]

Menus built with Menubar are styled using Menubar templates.

A Menubar template is a folder containing a PHP script named wpm3.php, one or more stylesheets, and possibly a few images.

The default Menubar templates are stored in wp-content/plugins/menubar/templates. If you plan to modify the default templates, you are advised to move them into a different folder, as explained in the First Installation section.

To apply a Menubar template to one of your Menubar menus:

1) In the Appearance – Menubar settings page select the menu to be styled, and click Edit Menu;

2) Select the template and the stylesheet to apply, and click Update Menu.

To customize a Menubar template you can edit the CSS rules contained in one of the stylesheets of that template. As already mentioned, you can also apply different CSS classes to individual menu items in order to better control the presentation of your menus.

[back to Contents]

Conclusions

I hope you like Menubar. If you have suggestions for improvement, if you need help, or if something is not working for you as expected, please use the Support Forum.

One thought on “Menubar

Comments are closed.