====== Indexmenu v2 plugin ====== ---- plugin ---- description: Show a tree menu for a namespace author : Ilya Lebedev email : ilya@lebedev.net type : syntax lastupdate : 2007-05-07 compatible : depends : remotescript conflicts : similar : indexmenu tags : tree, menu, index ---- ^ **Updated - 7 May, 2007** ^ [[http://cms.debugger.ru/dl/indexmenu2.zip|Indexmenu2 v2.1.1 (82Kb, zip)]]\\ [[http://cms.debugger.ru/dl/indexmenu2.tar.gz|Indexmenu2 v2.1.1 (55Kb, tar.gz)]]\\ [[http://cms.debugger.ru/dl/indexmenu2.7z|Indexmenu2 v2.1.1 (42Kb, 7z)]]\\ [[https://svn.debugger.ru/repos/common/DokuWiki/Indexmenu2/tags/Indexmenu2.v2.1.1| SVN repository, v2.1.1]]^ This [[plugin]] shows the index menu for a namespace. Its core features: * Powerful [[http://cms.debugger.ru|javascript engine]]. * Indexable menu, even in the JS mode. * Index is accessible, even if JS fail to load. * Support of multiple types of NS headpages: - classic indexmenu, headpage within namespace - ns/ns.txt - classic dokuwiki, headpage outside namespage - ns.txt - headpage as start page - ns/.txt * Support index sorting: filename, creation date, page title * Look&feel could be easily adjusted to any needs by changing the supplied CSS files * Ajax-aware submenus * Allows to convert any unordered list to the navigation menu, including nested indexmenus ===== Notes ===== * You can try it at [[http://cms.debugger.ru/en/start|English]] and [[http://cms.debugger.ru/ru/start|Russian]] pages of The Complete Menu Solution project. * Tested with [[http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2006-03-09e.tgz?id=projects%3Adokuwiki&cache=cache|2006-03-09e]] and [[http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2006-11-06.tgz?id=projects%3Adokuwiki&cache=cache|2006-11-06]] dokuwiki versions and the latest develsnaps. * Javascript code is commercial project with [[http://cms.debugger.ru/en/license#special_free_licenses|Special Free license]] for Indexmenu v2 plugin. * Ajax feature **requires** [[plugin:remotescript]] plugin. ====== Syntax for {{indexmenu}}====== Values in square brackets are optional. {{indexmenu>namespace[#[n][+nons]][#sort+[!]] [|js[#[theme][+ajax]]]}} ^ Option ^ Description ^Comments ^Req/Opt^ | **namespace** | Namespace name from which the index starts. | Take a look at [[namespaces]] for the complete reference. | required | | **n** | Number that specifies the max level of the tree index nodes. | With //**nons**// means the max depth of the pages to put in list. | optional | | **nons** | Exclude namespaces nodes from index. | When set, only pages are included in the index. | optional | | **sort** | Enable sorting | Indicates that menu should be sorted by the **sort_type** parameters | optional | | **sort_type** | One of the following: | **fn** - filename\\ **title** - page heading\\ **date** file creation date. \\ **!** - exclamation mark in front of the sorting mode means reversed sort. | optional | | **js** | Use JavaScript to add fancy dynamic stuff to the menu | //**[n]**// keeps its meaning | optional | | **theme** | Skin name for indexmenu2, when in //**js**// mode.| a theme is a set of CSS files and icons inside ''plugins/indexmenu/templates/DokuWiki/'' | optional | | **ajax** | Enables Ajax-driven index | When set, submenus below //**[n]**// level will be taken from the server using Ajax | optional | =====Examples== Example that display a javascript Index tree menu with nodes open till second level: {{indexmenu>wiki:plugins#2|js}} The same, when used on the [[wiki]] page {{indexmenu>:plugins#2|js}} ''Wiki'' theme for js option. {{indexmenu>wiki:plugins|js#DokuWiki}} Standard Dokuwiki index showing only pages inside wiki:plugins and lower namespaces (max two levels): {{indexmenu>wiki:plugins#2|nons}} Use 'IndexMenu' theme and build submenus below 2nd level using Ajax calls. {{indexmenu>wiki:plugins#2|js#IndexMenu+ajax}} Use 'IndexMenu' theme and build submenus below 2nd level using Ajax calls. Sort it by the page title in reversed order. {{indexmenu>wiki:plugins#2#sort+!title|js#IndexMenu+ajax}} ====== Syntax for ====== In general, options are equal to [[#syntax_for_indexmenu]], but it use only **js**, **theme** and **ajax**. //**Note:**// - Navigation module will suppress javascript and theme settings for the nested indexmenus. - Navigation module will remove any non-list content from its root, see example below. =====Examples== This example shows the general usage: this text will be removed, because it stay outside the menu * [[http://somesite| Some internet site]] * [[http://somesite/someurl| Interesting url on some site]] * [[http://somesite/someimage| {{http://somesite/someimage}}]] - image from some site * just a text, it won't act as a link * [[here should be a link to make submenu collapsible]] * no need to put anchors here * but, does it make a sense to create submenu without a links? * {{indexmenu>:#2#sort+title+rev|js}} ====== Configuration ====== ====dokuwiki-2006-03-09e== In this release, Indexmenu2 utilizes the global $conf['plugin_indexmenu'] options array. Array keys: **hide_headpage** - is kept as is. **skip_index** - new option. It is regular expression, describes what pages and namespaces will be removed from the index. Suggested option is: #\/(discussion|wiki|playground)(\.\w+)?$#i **empty_message** - message that will be printed, when no index is available ====dokuwiki-2006-11-06 and up== Use the built-in configuration manager. ===== Namespaces title and link ===== Showing the namespace title is controlled by global DokuWiki's option [[config:useheading]]. ===== Javascript menu ===== Javascript menu is implemented using [[http://cms.debugger.ru|The Complete Menu Solution]] code, adapted to DokuWiki standards. ==== Themes and skins==== Creation of new themes is slightly harder than in original indexmenu, but much more flexible. To create new skin follow next steps: - create folder under ''indexmenu/templates/DokuWiki/'', f.e. ''NewSkin'' - copy one of the existsing design.css files to ''indexmenu/templates/DokuWiki/NewSkin'' folder - find strings like CmsListMenuDokuWiki - replace with NewSkin Ok, new skin is done. Now you can update images or alter CSS definitions for your skin. For more detailed info check the [[http://cms.debugger.ru/en/api?idx=en:api|datasheet]]. Use your skin with **js#NewSkin** syntax, remember - skin name is case sensitive. Distribution contain 3 themes: * default, DokuWiki's list style * Simple, simple + and - signs next to nodes * IndexMenu skin, original indexmenu icons. ====== How to install ====== Download the [[http://cms.debugger.ru/dl/indexmenu2.zip|indexmenu2.zip]] file (82Kb) or [[http://cms.debugger.ru/dl/indexmenu2.tar.gz|indexmenu2.tar.gz]] (55Kb) and unpack it into ''lib/plugins'' folder or use the [[plugin:plugin]] manager. You have to cleanup DokuWiki cache after plugin install - remove all cached .js files. Otherwise you could receive javascript errors because of missing JS plugin part. ====== Changelog ====== * **2007-07-05 Version 2.1.1**: * added support for built-in index action replacement * JS engine switched to 0.5.12 release * **2007-13-02 Version 2.0.3**: * special Safari update * JS engine switched to 0.5.11 release * added ajax support to Safari * **2007-10-02 Version 2.0.2**: * put back missing 'title' calculation * fixed sorting * **2007-10-02 Version 2.0.1**: * fixed notice on missing argument * **2007-10-02 Version 2.0.0**: * fixed bug FS#9, link to namespace w/o the headpage now points to the $conf['start'] page * plugin considered stable and released * **2007-09-02 Version 2.0b5**: * 'rev' sort modifier replaced with ! mark * rewritten ajax callback, added sorting support (FS#11) * plugin **requires** [[plugin:remotescript|RemoteScript v0.8]] with new query interface * **2007-02-02 Version 2.0b4**: * fixed several issues * **2007-01-02 Version 2.0b3**: * fixed broken xhtml, thanks to kite [at] puzzlers [dot] org * fixed missing empty message * updated CompleteMenuSolution to 0.5.9 release * added support of '.' (current) namespace for the sidebars inclusion * **2007-01-09 Version 2.0b1**: * added component * made some refactoring * indexmenu now does not suppress standard link coloring * **2006-12-22 Version 1.11.3**: * fixed issue with incorrect path handling in ajax mode * **2006-12-12 Version 1.11.1**: * fixed issue with incorrect detection of the active template * **2006-12-12 Version 1.11**: * project has been uploaded to SVN * slightly changed the directory structure * fixed issue with incorrect detection of the root namespace * fixed incompatibility with [[plugin:include]], tested with Chris's release * fixed the number of small misspellings * **2006-08-12 Version 1.10**: * fixed RemoteScript callback, now it does return appropriate error message, if targeted namespace is empty * **2006-10-11 Version 1.9**: * added sorting * removed lots of the useless code * added support of the config manager * **2006-10-11 Version 1.8**: * fixed harvesting of subpages, when headpage is on the same level, as it's namespace. * **2006-10-10 Version 1.7**: * fixed RemoteScript plugin autodetection * added correct notice, when this plugin is not availavle * **2006-09-04 Version 1.6**: * fixed bug FS#4 - incorrect path used for other than root dokuwiki installation * **2006-09-04 Version 1.5**: * fixed bug FS#2 in JS mode: root namespace index does not work * **2006-09-03 Version 1.4**: * updated JS part to keep submenu open, when following it's link * if no headpage found, menu has the link to the NS's index * **2006-09-02 Version 1.3**: * rewritten entire menu creation code * refactored [[#Syntax]] part * removed the useless code * **2006-09-02 Version 1.2-r1**: * fixed errors under PHP 4.4.2 * **2006-08-31 Version 1.2**: * bugfixed IndexMenu theme for Opera 9 * updated Ajaxum plugin to detect [[plugin:remotescript]] presence * updated menu core * minor fixes * **2006-08-24 Version 1.1**: * rewritten code for list creation * added ajax controller and option * added dependency on [[plugin:remotescript]] * **2006-08-09 Version 1.0**: * Released. ====== Todo ====== ====== Bugs ====== Bugs are moved to [[plugin:indexmenu2:bugs]] ====== Discussion ====== >>The index menu doesn't show the title of the pages. It shows the wiki name (with underscores). Is there any configuration parameter to force this behaviour? --- //[[jferrando@cc.upv.es|Jorge]] 2006-12-26 10:31// >This behaviour is controlled by DokuWiki's config option [[config:useheading]] --- //[[ilya@lebedev.net|Ilya Lebedev]] 2006-12-26 10:54// Great! Worked like a charm. Thank you very much! --- //[[jferrando@cc.upv.es|Jorge]] 2006-12-27 10:59// ---- > I've noticed this plugin has a dependency on the RemoteScript plugin (for the AJAX stuff), which I feel should be documented here. Also when I try to use this feature, all I get is the "Loading..." message and nothing else happens. Any Ideas? --- //[[martin@martinsgill.co.uk|Martin Gill]] 2007-02-22 09:31// >> I have the same bug! version of dokuwiki 2006-11-06, indexmenu2 2.0.3 (13 February, 2007), remotescript 0.8.3 (13 February, 2007) --- //[[bukhalenkov.a@gmail.com|Bukhalenkov Alexander]] 2007-04-04 13:54// >> I can confirm that bug as well. I'm running the same versions as Bukhalenkov. --- //[[2007@huri.net|Huri]] 2007-04-05 20:57// Hello, Sorry for the long delay. Author of the plugin backend has released new library, that has no such a bug. Please, update RemoteScript with the 0.9 release, this bug should be solved. ===== Feature request ===== [[http://bts.debugger.ru/index.php?tasks=all&project=6|Bugtracker]] is available. === Navbar menu initially collapsed === >Would it be possible for the menu to be initially collapsed? I had no need in this, but it might be implemented. --- //[[ilya@lebedev.net|Ilya Lebedev]] 2006-10-01 00:08// ---- === Alphabetic sorting === Please add alphabetic soring entries in the menu! (i hope with utf-8 and standard php functions it`s simple) --- //[[bukhalenkov.a@gmail.com|Bukhalenkov Alexander]] 2006-10-26 22:06// Done, please refer the changelog and check the new options. --- //[[ilya@lebedev.net|Ilya Lebedev]] 2006-11-13 18:23// === index for current sidebar only === >>> Would it be possible to integrate this with @NS@ from [[plugin:var|Variable plugin]]? Then one could generate context sensitive index menus like: >>> {{indexmenu>@NS@#2|js#IndexMenu+ajax}} It would be very useful for sidebars. --- //[[vb@flash.ro|Vlad]] 2007-01-17// >> Will {{indexmenu>.#2|js#IndexMenu+ajax}} do the job? It refers to the namespace of the current page.\\ >> If this will not work for you, replace $id = resolve_pageid(getNS($ID),$ns,$exists); with $id = resolve_pageid(getNS(getID()),$ns,$exists); in the //syntax.php// or //syntax/indexmenu.php//. --- //[[ilya@lebedev.net|Ilya Lebedev]] 2007-01-18 23:56// > Actually it doesn't but my proposal wouldn't also. I imagined using this in the sidebar and I often don't have the sidebar in the same namespace as the pages. So neither ''.'' nor ''@NS@'' would work - they would just display the menu from to the sidebar's namespace not the page's namespace. Thanks for your answer though. --//[[vb@flash.ro|Vlad]] 2007-01-31// Actually, i've fixed this in the latest beta release, you can try it at hxxp://pg.debugger.ru/dw, take a look at sidebar, when browsing the pages --- //[[ilya@lebedev.net|Ilya Lebedev]] 2007-01-31 23:42// ----- === How to use the navigation module? === > Could you provide some more notes on use of navigation module. Is functionality provided by indexmenu2 plugin? If couldn't get above example to work. --- //[[greenboxster@gmail.com|Green Box]] 2007-02-01 10:31// Navigation functionality is implemented in the indexmenu-beta release, you can test it at hxxp://pg.debugger.ru/dw/articles Example: * {{indexmenu>:articles#1}} * {{indexmenu>:projects#1}} --- //[[ilya@lebedev.net|Ilya Lebedev]] 2007-02-01 13:15// === expanding current namespace, highlighting current page === >Hi Ilya, is it possible to have the same feature (or is it there already and I missed it?) as with the [[doku>plugin:indexmenu]] plugin with the //navbar// option to have the current namespace expanded and the current page highlighted. That would be very useful for navigation sidebars. >--- //[[stephane@artesyncp.com|Stephane Chazelas]] 2007/02/06 12:34// Hi Stephane, Yes, this is possible, but it should be done carefully. As far, as javascript engine does support the different CSS templates, it's possible to have not only the tree menu, but any kind of dropdown ones (for example), which should not be autoextended on page load. I'll take a look, how this could be implemented in a good way. --- //[[ilya@lebedev.net|Ilya Lebedev]] 2007-02-06 21:28// === Automatic list generation === > Is it possible to do the following? I insert the indexmenu tag into a page let's say indexpage to list all elements of a namespace alphabetically. When I create a new page in that namespace and chack the indexpage nothing will change. I have to edit and save the indexpage to see the new element in the list. Would be much comfortable to do this automatically. Thanks! --- //[[zorden@vipmail.hu|Zorden]] 2007-02-20 13:34 CET// Hello Zorden, Sorry for the long delay, but currently i have no idea, how to catch the change in the namespace. I'll take a look, and implement this, if it will be possible. --- //[[ilya@lebedev.net|Ilya Lebedev]] 2007-04-09 14:40// === This is an index over all available pages ordered by... === > Sorry, I am quite new to here, and just trying to remove the static message under INDEX menu. > "This is an index over all available pages ordered by namespaces". > Is it possible through indexmen2? Or I am just barking at the wrong tree? > Thanks in advace. Please, try the current (2.1.1) release, it allows to replace built-in index page and suppress the default message. --- //[[ilya@lebedev.net|Ilya Lebedev]] 2007-05-07 14:46// === Hide pages from IndexMenu === > Hi. I wanted to hide 'archived' pages. But I don't like to rename or move pages. So I added the following code in syntax.php: //Set title and link if (!$conf['useheading'] || !$title=p_get_metadata($id,'title')) $title=noNS($id); // hide titles starting with an # ... if( $title[0] == '#' ) return false; // $title=htmlspecialchars($title,ENT_QUOTES); $link=wl($id); > So, I can hide a page by editing the first heading. -- Christoph Purrucker, 2007-06-26 ===== Possible features =====