adahas

adahas

navigo

Current version: 1.2

Overview

This is a plugin for WordPress which allows you to display custom navigation menus (for applying different styles and highlighting) for pages.

Features

These are the list of features available in the current version.

  • Easy insertion to site, easy as copy and paste.
  • Can be inserted to page content or to the template files directly.
  • Complete customization from admin panel.
  • Supports any number of levels on navigation tree.
  • Selection for complete tree listing or collapsing tree listing.
  • Specific tree segment to display.
  • Two page ordering methods.
  • Custom class/id value setting.
  • Conforms to XHTML 1.0 Strict / XHTML 1.1

Requirements

  • WordPress 2.0 or above
  • JavaScript enabled browser for setting UI to work dynamically (optional, but recommended)

Installing

  1. Download the zip archive and extract it.
  2. Upload the files extracted to the plug-ins directory. (E.g. /wp-content/plugins/)
  3. When extracted, there will be a directory named ‘navigo’ under the plugins directory, and in the navigo directory, 3 files will be available
  4. Now the plugin should appear under the ‘Plugins’ tab in admin panel.
  5. Activate the plug-in.
  6. A new tab named after the plugin name will appear under the ‘Options’ tab in admin panel.
  7. That’s it.

Configuring

  1. Go to the ‘navigo’ tab under admin panel’s ‘Options’ tab.
  2. Change the ‘Settings’ as you prefer. If you can’t understand the settings, please read Settings Explained below.
  3. Code should be automatically generated in the boxes below, but if JavaScript is disabled, you’ll need to click the ‘Generate Code’ button after you have set the ‘Settings’.
  4. Then ‘Copy’ the code that you want and ‘Paste’ it where you want the navigation list to appear. Please note that you don’t need to use both, if you are inserting it using admin panel’s ‘Write’/'Edit’ functions, use the ‘Generated Code for Pages’. Otherwise if you want to place it on a template file, use the ‘Generated Code for Templates’.
  5. Now, when you see the page/post you should see the navigation list.

Settings Explained

WordPress arranges the pages in a hierarchical manner (similar to a tree structure), so some of the ‘Settings’ for this plugin are based on that tree. Following is a sample tree that will be used to explain some settings later in this document.

Note: The values in brackets are their Page numbers.


root (0)
|
|-- About (1)
|
|-- Services (4)
| |
| |-- Software Solutions (6)
| | |
| | |-- Products (10)
| | |-- Support (11)
| | |-- Clients (12)
| |
| |-- Web Design (9)
| | |
| | |-- Style (15)
| | |-- Technologies (18)
| | |-- Portfolio (16)
|
|-- Contact (2)

Now we’ll look at each setting. Please note that each setting is explained assuming that the rest of the settings are set to their default values.

Root page number – This will specify which page number to be treated as the root page number for the navigation list generated by ‘navigo’. The default value is zero, which is the root page of the actual navigation tree.

E.g. If the ‘Root page number’ is set to ‘4′, the list will contain all its child elements, but not the parent Page. The out put will be,


|-- Software Solutions (6)
| |
| |-- Products (10)
| |-- Support (11)
| |-- Clients (12)
|
|-- Web Design (9)
| |
| |-- Style (15)
| |-- Technologies (18)
| |-- Portfolio (16)

No of child levels to show (from root) – This will specify how many child levels to show starting from the ‘Root page number’ that was specified in the above setting. The default value zero, will display all child levels.

E.g. If the ‘No of child levels to show’ is set to ‘1′, the list will only contain the first level of child Pages of the tree, but not the root Page. The output will be,


|-- About (1)
|
|-- Services (4)
|
|-- Contact (2)

No of top levels to hide (from root) - This will specify how many child levels to hide from the tree starting from the ‘Root page number’ specified. The default value zero, will not hide any top levels.

E.g. If the ‘No of top levels to hide’ is set to ‘2′, the list will contain all the Pages of child levels excluding the first and second levels. The output will be,


|-- Products (10)
|-- Support (11)
|-- Clients (12)
|-- Style (15)
|-- Technologies (18)
|-- Portfolio (16)

Display collapsing tree – This is a toggle option, when unselected, ‘navigo’ will show all the Page links in the list(subjected to the above settings) which are and are not parent/child Pages of the current Page. When this is selected, ‘navigo’ will only show the parent and child nodes of the current page, leaving out the others.

E.g. If the ‘Display collapsing tree’ is NOT selected, and the Page that is currently displayed is ‘Support’ (Page 11), the output will be,


root (0)
|
|-- About (1)
|
|-- Services (4)
| |
| |-- Software Solutions (6)
| | |
| | |-- Products (10)
| | |-- Support (11)
| | |-- Clients (12)
| |
| |-- Web Design (9)
| | |
| | |-- Style (15)
| | |-- Technologies (18)
| | |-- Portfolio (16)
|
|-- Contact (2)

And if the ‘Display collapsing tree’ IS selected, and the Page that is currently displayed is ‘Support’ (Page 11), the output will be,


root (0)
|
|-- About (1)
|
|-- Services (4)
| |
| |-- Software Solutions (6)
| | |
| | |-- Products (10)
| | |-- Support (11)
| | |-- Clients (12)
| |
| |-- Web Design (9)
|
|-- Contact (2)

Page order – This will specify in which or to present the Pages in each level. If ‘Alphabetical Order’ is selected, each level will be sorted in the Alphabetical order, and if Page Order is selected, each level will be sorted by the Page order specified for each page.

Level n Class/ID: This specifies a custom Class/ID name for each level specified by ‘n‘. The selection of Class or ID to use will be automatic based on the selection of the setting ‘Display collapsing tree’. If it’s selected, IDs will be used, otherwise Classes.

More » / « Less: This will allow you to specify more Class/ID names for deeper navigation trees.

Download

Change Log

  • 1.2 – Fixing the permission on the setting UI in the admin panel with latest WordPress versions, adding navigo’s own plugin directory over the previous way of adding the files to plugins root.
  • 1.1 – A minor bug was found and corrected.
  • 1.0 – Initial version.

Questions and Bug Reports

If you have any question or have found a bug in this plugin, please contact me, and I’ll bet back to you as soon as possible.

  • [...] Navigo Normalerweise ist die Seitennavigation in Wordpress statisch, und alle Seiten werden ausgeklappt dargestellt. Mit dem Navigation-Plugin Navigo lassen sich aber sehr einfach horizontale und vertikale Menus erstellen die ausklappbar sind. [...]

  • Josh says:

    Hi. Is this Plugin compatible with WP 2.8?

  • Hi Guys, this plugin is now compatible with WordPress 2.9 as well! Enjoy!

  • wolfgang says:

    Hi!

    I’ve just wondered why the navigo( function does not support to exclude given pages (because the wp-command which is used “get_pages” supports the exclusion) so I quickly added the “exclude” parameter as follows:
    Added at the begining of the navigo methode:
    if (!isset($r['exclude'])) $r['exclude'] = ”;

    and this after where the $pages_params get the sort_column appended:
    if(strlen($r['exclude']) > 0){
    $pages_params = $pages_params.’&exclude=’.$r['exclude'];
    }

    So to avoid of having the page 3 in the navigation you can simply add &exclude=3 to where you call the navigo function

    Greetings from Austria
    Wolfgang

  • Very good point, thanks! I’ll integrate that to the plugin on the next release. Cheers!

  • Theo says:

    @wolfgang or an other one who can help me,

    i’ll be exclude some pages, but your code will not be work correctly on my site. Is this code OK? or have i a missing. Can you give a complete example please?

    php if (!isset($r['exclude'])) $r['exclude'] = “”; if(function_exists(‘navigo’)) navigo(’sort_column=post_title&exclude=11′); if(strlen($r['exclude']) > 0){
    $pages_params = $pages_params.’&exclude=’.$r['exclude'];
    }

  • manjunath says:

    Thanks a lot for navigo it’s really very nice plugin!

  • flo says:

    @theo
    I posted the modified navigo (including the exlude stuff) here: http://pastebin.com/2JSFN2ni

  • [...] it does not support more than two levels, which was not meeting the client’s requirements. Navigo 1.2 offers XHTML strict output, works with WPML and offers custom classes and IDs for formatting the [...]