Tags:
component1Add my vote for this tag navigation1Add my vote for this tag create new tag
, view all tags

A navigation bar plugin

Add "Previous, Up To Contents & Next" navigation icons or text to TWiki topics.

Principle

If a topic contains the key %NAVBARINDEX%, it is parsed on save for bullet lines starting with an existing topic name, between the lines containing the keywords %NAVBARINDEX% and %NAVBARINDEXEND% (if present, or end of topic), which creates an index to the topics. (named .navbarcache in each web). Example:
%NAVBARINDEX%
   * FirstSubTopic optionnally followed by some text
   * SecondSubTopic with some other text

Indexed topics then has the tag %NAVBAR% expansed into a navigation bar. (of the form Prev Up Next, links to previous topic, index topic and next topic). This tag should be normally part of the skin template, you do not have to add them to your topics by hand.

It works by maintaining a cache of indexed topics in the web, updated when saving the topics. It thus needs for the Dec 2001 release a patch to add a plugin hook on save functionality that will be present in the next stable release (Falll 2002): TWiki:Codev/PluginHookOnSavePatch

It was inspired by the NavPlugin, with the following features:

  • No need to add special tag in indexed pages: only once in the index
  • Faster: NavPlugin could double rendering time of big pages

The %NAVBAR% tag can accept options, of the form:

   %NAVBAR{prefix="html code..." suffix="html code..." graphics="on"}%
  • If NAVBAR is expansed, it will be prefixed and suffixed by the corresponding arguments, if any
  • if graphics is not specified, the navbar is in text form, as Prev Up Next links. If set to on, it will use icons. Text will be striked out and icons will be greyed out When there is no previous or no next topic.
    graphics can be either the keyword on, or a string XXX that will be used to get the URL of a set of images, by appending -next,gif, -nexti.gif, ....
    The default, graphics="on" implies for instance:
    Plugins/NavbarPlugin/nav
  • another optional argument is size, giving additionnal parameters to the img tag for html icons when you use the graphics parameter, to giveheight and width for faster rendering for instance. Its default value (when using graphics="on" is:
    size="width=16 height=16"

See NavbarPluginExample at http://koala.ilog.fr/wiki/bin/view/Plugins/NavbarPluginExample

Plugin Settings

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Add "Previous, Up To Contents & Next" navigation icons or text to TWiki topics.

Plugin Installation Instructions

  • Download the ZIP file from the Plugin web (see below)
  • Unzip NavbarPlugin.zip in your twiki installation directory.
  • Test if the plugin is correctly installed, by
  • If you want to use it, modify your skin templates to include %NAVBAR% where you want
In the standard TWiki skin, you may want to edit templates/view.tmpl, to add two lines:
   %NAVBAR{prefix="<div align=right>" suffix="</div>"%
one just before the %TEXT% line, one just before the %META{"attachments"}% line

Known Issues/Limitations

  • All pages referenced in the index must be in the same web as the index page.
  • There is a possible race condition if 2 people save at the same time an index topic in the same Web. Re-saving them should do the trick.
  • Moving / Renaming the index or the topics is not handled. If anything goes wrong, just removing the .navbarcache and re-saving every index topic will fix thing.
  • Creating an entry for a non-existing topic in the index, then creating the topic will not work (as the file do not exists yet as the time of index save). Just edit/save the index once when all topics are defined to be sure.

Plugin Info

Plugin Author: ColasNahaboo
Plugin Version: v1.1
Change History: v1.0, 11 Sep 2002: Initial version
v1.1, 12 Sep 2002: size parameter, better examples
v1.2, 20 Sep 2002: Topics with numbers in their names were not indexed
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.0
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/NavbarPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/NavbarPluginDev

Files

  • lib/TWiki/Plugins/NavbarPlugin.pm
  • data/Plugins/NavbarPlugin.txt
  • data/Plugins/NavbarPluginExample.txt
  • data/Plugins/NavbarPluginExampleFirst.txt
  • data/Plugins/NavbarPluginExampleMiddle.txt
  • data/Plugins/NavbarPluginExampleLast.txt
  • pub/Plugins/NavbarPlugin/nav-next.gif
  • pub/Plugins/NavbarPlugin/nav-nexti.gif inactive (greyed out) version.
  • pub/Plugins/NavbarPlugin/nav-prev.gif
  • pub/Plugins/NavbarPlugin/nav-previ.gif inactive (greyed out) version.
  • pub/Plugins/NavbarPlugin/nav-up.gif
  • pub/Plugins/NavbarPlugin/nav-upi.gif inactive (greyed out) version.

-- ColasNahaboo - 23 Sep 2002

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 NavbarPlugin.md5 r2 r1 manage 0.2 K 2008-12-12 - 11:48 SopanShewale checksum file , Uploaded as a part of Release Process
Compressed Zip archivetgz NavbarPlugin.tgz r2 r1 manage 8.5 K 2008-12-12 - 11:48 SopanShewale See NavbarPlugin for details. Untar and run the installer script, Uploaded as a part of Release Process
Compressed Zip archivezip NavbarPlugin.zip r5 r4 r3 r2 r1 manage 12.8 K 2008-12-12 - 11:48 SopanShewale See NavbarPlugin for details. Unzip and run the installer script , Uploaded as a part of Release Process
Unknown file formatEXT NavbarPlugin_installer r2 r1 manage 3.8 K 2008-12-12 - 11:48 SopanShewale Installer Script, Uploaded as a part of Release Process
Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r13 - 2008-12-12 - SopanShewale
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.