wiki:NavigationMenuPlugin

Version 6 (modified by Beider, 8 years ago) (diff)

spelling errors

Subtree Navigation Menu

Description

General

This is a newer version of the menu. It was originally just a simple menu based on SubWiki and TocMacro but now I have expanded it with a bunch of new functionality to make it more flexible. This menu is intended to be a heavy setup / low maintainance menu.

Here is a list of the most general features.

  • A default menu for all pages read from a wikipage (DefaultNavigationMenu)
  • Ability to add sections or include other menus within menus (like the default one)
  • Ability to generate subtrees from pages
  • Ability to use WikiFormatting inside the menu
  • Generate a menu over headings on the current page

First of all make a new page called DefaultNavigationMenu, and then add the [[TOC]] reference into some page where you want the menu, NOT on DefaultNavigationMenu

Optional Way
Make a new page called whatever you like, example : MyMenu. Then add [[TOC(incmenu=MyMenu]] to the page where you want to display the menu.

Now go and edit either DefaultNavigationMenu or the page you decided on for your menu. Then just start designing the menu as you like with the commands below, use new line (enter) to separate commands. You may also add empty lines but you may not have two commands on the same line.

Argument Meaning
SETTINGS
heading=<x> Override the default heading of "Table of Contents"
noheading Suppress display of the heading.
inline Display TOC inline rather than as a side-bar.
ACTIONS
#text A comment line. Start the line with a hash sign (#)
[CPH] Creates a page header list for the current page
[S]Some/Page/Path Starts a section. If you specify something like GameDesign, it will display on the GameDesign page and all subpages GameDesign/*. Sections can have multiple subsections. Note: It will also display on any similar pages like !GameDesign2/*.
[!S]x Ends the last opened section. You may place a comment where it says x to make it easier to read
[N] New line. Adds an empty line, similar to [[BR]] for WikiFormatting
[H]x Adds a header with the text x.
[*** Starts a WikiFormatting section. Make sure you close it because all menu commands are ignored inside it, and it will not be rendered unless it is closed. You may include macros / other plugins or just wiki format code. Has to be written on a line by itself.
***] Ends the WikiFormatting section. Make sure you close all WikiFormatting sections or they will not render.

Bugs/Feature Requests

Existing bugs and feature requests for NavigationMenuPlugin are here.

If you have any issues, create a new ticket.

Download

http://trac-hacks.org/attachment/wiki/NavigationMenuPlugin/TracNavigationMenu-1.0-py2.4.egg

Source

http://trac-hacks.org/attachment/wiki/NavigationMenuPlugin/NavigationMenu.rar

Example

Page : TestMyMenu

== Test My Menu ==
[[TOC]]

Page: DefaultNavigationMenu

# This is the default navigation menu page
# Any page that simply specify {{{[[TOC]]}}} will get this menu.

heading=Default Navigation Menu

#This will create a subtree for all pages that starts with Wiki
Wiki

#Makes a new line
[N]
#Creates a link to all pages starting with TracNotification
TracNotification

#Only Show this section on pages starting with Trac
[S]Trac

   #Overwrite the heading
   heading=Trac Section!

   #A new line and a header saying Trac
   [N]
   [H]Trac
   #Generate subtree for all pages starting with Trac
   Trac

   [S]TracNotification
      #Only show this on pages starting with TracNotification
      
      [N]
      [H]Where am i?
      [*** Start of WikiFormatting code

         You are now on the TracNotification page!

      ***] End WikiFormatting Code
      [N]

      #Imports another menu at this point
      incmenu=Menus/TracNotificationMenu

   [!S] End TracNotification Section

[!S]End Trac Section

[N]
[H]The time is
[*** WikiFormatting Begins
[[Timestamp]]
***] WikiFormatting Ends

Recent Changes

[1664] by Beider on 2006-12-09 04:52:46
New hack NavigationMenuPlugin, created by Beider

Author/Contributors

Author: Beider
Contributors:

Attachments (2)

Download all attachments as: .zip