adahas

අදහස්

Download Day

navigo

Current version: 1.1

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
  • Compatible to be served as application/xhtml+xml

Requirements

  • WordPress 1.5 or above
  • JavaScript enabled browser (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. Now the plugin should appear under the ‘Plugins’ tab in admin panel.
  4. Activate the plug-in.
  5. A new tab named after the plugin name will appear under the ‘Options’ tab in admin panel.
  6. 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.1
    • A minor bug was found and corrrected. (Thanks to philippe)
  • 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.

46 responses to 'navigo'

  1. […] menus (for applying different styles and highlighting) for pages.” See more info on navigo

    This was posted on Wednesday, May 25th, 2005 at 3:27 pm and is filed under WordPress.
    […]

  2. […] to launch his website Adahas. Already he has a few things that you might find very useful: navigo, a Wordpress plugin for creating flexible navigation menus; intouch, an Ajax enabled customisable contact f […]

  3. […] go en esta página. La mayoría no, así que bajas este plugin y listo. -Navigo: Para hacer “menús” de navegación en las páginas de WP, lo estoy probando […]

  4. […] Testing Archives Contact Plugins Testing navigo - Very useful! « Installed Contact form […]

  5. […] stuff if a comment has been posted by a logged in user (like apply a different CSS style) Navigo — Replacement for the default page menu generating function This entry was […]

  6. […] st ein Feature, das man bei einem CMS erwartet. Für Wordpress gibt hier es das Plugin navigo. Es baut hierarchische Navigationen selbst definierbare […]

  7. Hermann Josef Eckl says:

    Hi, I’m trying your WP “navigo” plugin with the new WP 2.0. It seems to be compatible with some minor inconsistencies: (1) the plugin has to be in the wp_content/plugins root directory (it must not be in a subdirectory) and (2) the navigo options page is not in the (new) plugin-options tab, but in the global options tab. Will you update your PlugIn to WP 2.0? This would be nice, because it’s one of the best and most useful plugins. - Nevertheless, navigo is fully functional with WP 2.0, so I will use it immediately fo my site. Thank you for this fine piece of code! Greetings, Hermann J. Eckl

  8. peapo says:

    hi!
    i don’t understand how 2 use this very nice plugin . can anyone show to me how i have to configure this plugin by a videotutorial or something like that pls ?

  9. Michael says:

    I have just added a possibility to exclude certain pages, so you can exclude e.g. pages with ID numbers 13, 63 and 89.
    I realized it by adding the new option “exclude=”; with that you can exclude one or more pages by ID.
    Excluding a page will also exclude all of its sub pages if it has any.

    Implementation:
    1) Open navigo.php
    2) Search for if (!isset($r['sort_column'])) $r['sort_column'] = '';
    3) Add after:

    if (!isset($r['exclude'])) {
    $r['exclude'] = '';
    } else {
    $r['exclude'] = preg_split('/[\s,]+/',$r['exclude']);
    }

    4) Search for:

    foreach($pages as $page) {
    $page_tree[$page->ID]['title'] = $page->post_title;
    $page_tree[$page->ID]['name'] = $page->post_name;
    $page_tree[$page->post_parent]['children'][] = $page->ID;
    }

    5) Replace with:

    foreach($pages as $page) {
    $excludepage = false;
    if ( !empty($r['exclude']) ) {
    if ( in_array($page->ID, $r['exclude'], true) )
    $excludepage = true;
    }
    if ( $excludepage == false ) {
    $page_tree[$page->ID]['title'] = $page->post_title;
    $page_tree[$page->ID]['name'] = $page->post_name;
    $page_tree[$page->post_parent]['children'][] = $page->ID;
    }
    }

    How to use:
    Simply add the exclude parameter to the function, e.g.

    navigo('exclude=13,63,89&collapse=true&sort_column=menu_order&level1=menulev1&level2=menulev2');

  10. […] 52;r Wordpress gibt hier es das Plugin navigo. Es baut hierarchische Navigationen selbst definierbarer Tiefe auf, die auf Wunsch auch aufklappen; d.h. es […]

  11. […] 加Quote表的内容; 添加几个常用插件,如管理数据库的、添加TOC的、修改导航条的等等。。。 11:41 am No Comments » No comments yet. RSS f […]

  12. Karl says:

    Hi,
    used your plugin,
    but get an error :
    Warning: Invalid argument supplied for foreach() in /home/www/web30/html/wp-content/plugins/navigo.php on line 135

    The code pasted in a static page with WordPress 2.0.1

    HowTo
    This Area contains snippets; My experience in the Oracle Server Performance Forum is that very often questions need not be answered manually again and again. Sometimes a simple link with the right content will help. For example HowTo gather System stats.

    Any suggestion?

    Karl

    code in File navigo.php

    function _navigo_subs($parent, $page_tree, $r, $parents, $pages, $indexes, $queried_obj, $current_level) {

    $content = ‘’;

    foreach($page_tree[$parent][’children’] as $page_id) {

    // get a reference to the current page for easy access
    $cur_page = $page_tree[$page_id];

  13. Karl says:

    The code was : navigo:child_of=2, depth=1, collapse=false, sort_column=post_title

  14. […] Expertinnen-Web: Beitrag über das Plugin navigo, mit dem hierarchisch gegliederte Seitennavigationen in Wordpress eingebunden werden können. » Zum Plugin navigo » […]

  15. […] navigo (zur Erstellung praktischer Mens, bei denen die Unterpunkte einklappen) […]

  16. Very nice plugin. I’ve searched for days for a similiar function to categories. I only want to see the children-cats when viewing the parent cat. But no wordpress-fenction and no single plugin ist able to achieve this. :-/
    With JavaScript the main cats open the children-cats but are no longer working links.

    Maybe Your plugin is a little bit suited for my (and many others) purpose.

  17. Dusty says:

    I’m not sure if this is new to Wordpress 2.0.4, but I was getting the following error when trying to go to the options page: “Fatal error: Call to undefined function: load_plugin_textdomain() in …”

    I found the fix on this page at the German Wordpress site.

    1. Move both navigo-options.php and navigo.php to the plugins folder (do not put them in a subfolder).
    2. Open navigo.php in a text editor and change line 221 (near the bottom) from add_options_page(’navigo Options’, ‘navigo’, 9, ‘navigo-options.php’); to add_options_page(’navigo Options’, ‘navigo’, 9, ‘/wp-content/plugins/navigo-options.php’);

    Hope that helps some that had the same problem. Thanks for the nice plugin, Venushka!

  18. I use the script

    but get the warning
    Invalid argument supplied for foreach() in xxx/wp-content/plugins/navigo.php on line 135

    which is ” foreach($page_tree[$parent][’children’] as $page_id) {”

    as posted before. Any hints ?

  19. […] Navigo 1.1 […]

  20. lab69 says:

    Hello,

    I have implement your plugin in widgets using execphp plugin which allows tu use PHP in a widget window. I have used the navigo option to generate php code. I have put the code generated for template in the execphph widget. It works well but i have lost the indentation, so pages and child pages are at the same indentation level (to see it : www.claude-arnaud.com).

    Can someone help me to sort this out ?

    Many thanks

    Thanks a lot.

  21. […] 15. Wordpress als CMS nutzen: Auch das geht. Siehe Codex (mit zahlreichen Links), Wolkenfetzen, Navigo wegen dynamischer Navigation, Static Frontpage Plugin für die Startseite, noch besser ist imho das Filosofo Homepage Control Plugin […]

  22. Nina says:

    How can I also display the frontside of the blog in the navigation-list? It is not considered a “page” and so it is not listed. But I’d really like to have “news” as first item of the navigation.

  23. Nina says:

    Is it possible to use “Sidebar Page Switcher” with this plugin?
    http://www.hobbingen.de/software/wordpress.php

    SPS adds the option to “not show” pages without needing to manually edit the “exclude” info in the file. Instead you can choose it as an option in the admin area.

  24. OverflooD says:

    I’ve modded the very fine plugin. I’ve need to exclude the childs of an ID, but not the ID directly. And I couldn’t exclude each ID, that would be to much work for my glossary. So I’ve modded these lines:

    – After this codeblock: –

    // For execludes
    if (!isset($r[’exclude’]))
    $r[’exclude’] = ‘’;
    else
    $r[’exclude’] = preg_split(’/[\s,]+/’,$r[’exclude’]);

    – Add follow Lines: –

    // For execludes of a child // 432
    if (!isset($r[’exclude_child_of’]))
    $r[’exclude_child_of’] = ‘’;
    else
    $r[’exclude_child_of’] = preg_split(’/[\s,]+/’,$r[’exclude_child_of’]);

    – After this codeblock: –

    $excludepage = false;

    if ( !empty($r[’exclude’]) )
    {
    if ( in_array($page->ID, $r[’exclude’], true) )
    $excludepage = true;
    }

    – Add follow Lines: –

    // Excludes of childs from parents // 432
    if ( !empty($r[’exclude_child_of’]) )
    {
    if ( in_array($page->post_parent, $r[’exclude_child_of’], true) )
    $excludepage = true;
    }

    I think its very usefull. Now it can be used with: exclude_child_of=123

    I hope i could help someone.

    Best regards
    Patrick

  25. […] Jetzt haben wir das Layout. Es fehlt noch die linke Navigation. Für eine gut anpassbare Navigationsleiste verwenden wir ein leicht modifiziertes Navigo-Plugin , um auch bestimmte Seiten ausblenden zu können. Das könnt ihr Euch hier herunterladen. Die beiden Dateien einfach in das WordPress-Plugin-Verzeichnis kopieren und das Plugin aktivieren. […]

  26. John says:

    Awesome plugin, Venushka! Thanks so much.

  27. […] custom navigation menus (for applying different styles and highlighting) for pages http://adahas.com/work/navigo/ […]

  28. juergen says:

    Hi, I got a problem with the Navigo plugin:

    Submenue doesn’t show up on the start page:
    http://www.grenzenlos-ggmbh.de/wordpress/

    But if I hit the navi button for that page, everything works fine. Then the command line shows:
    http://www.grenzenlos-ggmbh.de/wordpress/?page_id=3

    I use Filosofo Home-Page Control to have a static page as homepage and permalinks are set to default.

    Strange thing: If I change permalink settings to any other option (numeric for example) the menues are shown, but as I click one of their links, this annoying »Not found« message comes on screen.
    Although the link should point to the page id, it actually points to s.th like: http://www.grenzenlos-ggmbh.de/wordpress/start/aktionsangebote/

    I also tried another plugin called »Static Front Page« instead of Filosofo, but it didn’t help.

    Any idea how to workaround that issue?

    PS: I really appreciate navigo as a great piece of code! Thx in advance!

  29. […] geschrieben: 27.Dezember 2006 Kategorie: Unter Peter | navigostellt statische Seiten (pages) an x- beliebige Stelle im Template und collapst diese, falls Unterebenen vorhanden sind. Standardmässig ist in WP die Navigation aufgeklappt. […]

  30. abietto says:

    I tried to implement your plugin with the “exclude” feature on a website (since I wanted to have some pages on the “upper” links, like “contacts”, et cetera, and other pages nested in the sidebar), and everything was working fine. I just made a copy of it on another website running WP, and it does not work. It says “Warning: Invalid argument supplied for foreach() in …./wordpress/wp-content/plugins/navigo.php on line xxx”. The website is www.aliceincitta.org and I checked that line in the code but it does not seem to be relevant… Anyway, why should the exact same file of the plugin work on a website and give problem on another one? Can you give me some advice?

  31. abietto says:

    Seems like I found out what was the problem: you can’t exclude *all* the pages: if you do, you get an error message. You have to leave at least one page in the sidebar!…

  32. […] Gerade wenn man viel Inhalt auf seiner Seite hat stellt man sich oft die Frage ob es nicht möglich wäre in der Wordpress-Navigation immer nur die Unterseiten der jeweils gerade aktiven Hauptseite anzuzeigen. Es geht. Mit dem Plugin Navigo ist das kein Problem. Ein tolles Toll das für die individuelle Gestaltung der eigenen Seite ganz neue Möglichkeiten bietet. […]

  33. […] Für alle, denen Validierung nach XHTML wichtig ist hier eine kleine Verbesserung für das Navigo-Plugin. […]

  34. maria says:

    unfortunately the navigo menu doesn´t work anymore with the latest wordpress version, but i´d really like to keep ist, because it´s better than the standard list pages function of wp.
    is it possible to get an update?
    thanks maria

  35. […] Visit […]

  36. dr770 says:

    Great plugin! Is it any way to make it compatible with multilanguage plugin polyglot: http://fredfred.net/skriker/index.php/polyglot/ ?

  37. When applying CSS styles to the different levels…such as .level1 {color: blue;) all of the levels underneath are effected by it. How can I make my upper levels or parents have different CSS styles then the childs? It would be nice to be able to use the upper levels as headings and the lower ones as list items. But more importantly, I can not change the look of parent without changing its child.

  38. Tiram says:

    This plug-in seems to be exactly what I need, but I can’t seem to make it work:\ I’ve put this into the sidebar (I hope the code displays correctly):

    <?php if(function_exists(’navigo’)) navigo(’collapse=true&sort_column=menu_order’); ?>

    … which, if I’ve understood the instructions correctly, should give me this menu on the home page:

    » 2006
    » Snarveier
    » Galleri

    … and e.g. this if I click “Snarveier” - “Lenketestside” being a sub-page of that page:

    » 2006
    » Snarveier
    -» Lenketestside
    » Galleri

    But the menu doesn’t expand at all. When I do manage to make it expand, it expands everything, like this:

    » 2006
    » Snarveier
    -» Lenketestside
    - -» Handleliste
    » Galleri
    -» Bildegalleri
    - -» tags

    Any ideas as to what might be wrong? You can see it here, in the sidebar under the heading “Menytest navigo”:

    http://tiram.org/blogg/

    T :?

  39. Christian says:

    Hi,

    navigo doesnt work in WP 2.2.1.
    The error:
    If I click in Admin-Area > option on “navigo”, the homepage comes up. But the link to /wp-admin/navigo-options.php is right in statusbar.

    What can it be?

    Thanks,
    Chris

  40. […] Wenn Sie viele statische Seiten anlegen oder verschachtelte Listen verwenden möchten, wäre diese Option nicht zu empfehlen. In dem Falle würde ich lieber das Plugin Navigo empfehlen. Wenn Sie jedoch, wie auf dieser Seite hier, nur einige Headerseiten, wie zum Beispiel Kontakt verwenden, wäre folgende Variante optimal: […]

  41. Jan says:

    I will make a better navigation with this plugin.
    Thank you very much

  42. […] Inzwischen setze ich Wordpress für kleinere Sites immer häufiger als CMS ein, aufwändige Navigationskonstrukte sind damit allerdings bisher schwer umzusetzen. Meist arbeite ich dann mit Navigo. Das Plugin erlaubt das Ausschalten bestimmter Navigationsebenen. Damit lässt sich dann z.B. nur die oberste Ebene der Navigation anzeigen oder halt nur die Unterpunkte. Zudem erhalten alle aktiven Haupt- und Unterpunkte eine aktive Klasse, aus der sich per CSS ein ganz brauchbares Navigationssystem bauen lässt. Allerdings nur solange alle Menüpunkte gemeinsam genutzt werden. […]

  43. […] Abhilfe verspricht das Plugin navigo, damit lässt sich ein Navigationsmenü wie hier auf software-guide.de realisieren. Ich rufe das Plugin dabei in der index.php meines Themes an der Stelle, wo das Menü erscheinen soll, wie folgt auf: […]

  44. RHO says:

    First I wann thank you for that great Plugin.

    My Question:
    Is ther a way to click on a root-link and go straight to the first child of it?

    something like that:

    root (0)
    |
    |– About (1)
    |
    |– Services (4)
    | |– Products (10)
    | |– Software Solutions (6)
    | |– Support (11)

    by clicking on Services it goes directly to Products.

    Thanks for your answers

  45. […] Business Capital has a nice horizontal menu with drop-downs. Most of them are just (parent) pages with children and then grandchildren. Fine, good, works fine. But either it was a glitch or just too late at night, but when on a sibling page, the drop-downs for that parent no longer dropped down. Hmm. Tried some template tag tricks to no avail. Did a bit of a plugin search and came across Navigo. […]

  46. Israel says:

    Great plugin!!
    I have it working on some V2.3 sites, but now that I have upgraded to 2.5 the plugin does not work.
    Could you tell me if this is compatible with WP V 2.5, I just want to make sure I’m not ding something wrong.

    Thank you

leave a reply

Please feel free to leave a comment about this post.

(required)
(will not be published ,but required)