r1 - 31 Aug 2006 - 15:16:04 - TWikiGuestYou are here: TWiki >  TWiki Web  > BreadCrumbsPlugin

BreadCrumbsPlugin

Description

This plugin has the sole purpose to help you in locating where you are and how you can escape from there using breadcrumbs navigation.

For now this plugin generates so called "location" breadcrumbs. Compare this to "path" breadcrumbs indicating the path a user has taken to arrive at a page which is a kind of page history without navigation circles. But this is not yet supported by the BreadCrumbsPlugin.

In a way location breadcrumbs have always been supported by TWiki using the META{"parent"} variable to display the list of partent topics. Since version 4.x TWiki also supports hierarchical subwebs but the breadcrumbs support of TWiki does not allow to display the parent webs as part of of the location breadcrumbs. Besides that this plugin adds more flexibility in deciding which parts of the breadcrumbs path should be rendered and how each individual breadcrumb is displayed

Syntax

%BREADCRUMBS%, %BREADCRUMBS{"<web>.<topic>" ...}%

Parameters:

  • <web>.<topic>: the location to which breadcrumbs should be generated; defaults to the current topic
  • header: format string prepended to the output result
  • format: format string to render one item on the breadcrumbs path (defaults to '[[$target][$name]]')
  • footer: format string appended to the output result
  • separator: format string to be put between items (defaults to one space char)
  • include: regular expression items must match to be part of the path
  • exclude: regular expression items must not match to be part of the path
  • recurse: can be one or more of the following values (comma separated) to deside which parts of the breadcrumbs path should be included (defaults to 'on'):
    • on: include all parent webs and all parent topics
    • off: include only the current web and the current topic
    • weboff: don't recurse on webs, include only the current web
    • topicoff: don't recurse on topics, include only the current topic
    • webonce: include the next parent web but not the parent web's parent web
    • topiconce: include the next parent topic but not the parent topic's parent topic
    • once: short formf of webonce, topiconce

Pseudo-variables:
Each of the above format strings (format, header, footer, separator) may contain special variables:

  • $name: the name of the breadcrumb, this is the topic name or the web name having its parent web part being stripped off (that is Bar instead of Sandbox/Foo/Bar)
  • $target: the full web.topic of the breadcrumb
  • $n: replaced with a newline char (\n)
  • $percnt: replaced with a percent char (%)
  • $dollar: replaced with a dollar char ($)
  • $nop: removed from the format string before expanding common TWiki variables

Examples

default

%BREADCRUMBS%
TWiki BreadCrumbsPlugin

breadcrumbs to a non-existent location

%BREADCRUMBS{
  "Web1/Web2/Web3.Topic" 
  format="$name" 
  separator=" &#187; "}%
Web1 » Web2 » Web3 » Topic

recurse="off"

%BREADCRUMBS{
  "Web1/Web2/Web3.Topic" 
  format="$name" 
  separator=" &#187; " 
  recurse="off"}%
Web3 » Topic

recurse="once"

%BREADCRUMBS{"Web1/Web2/Web3.Topic" 
  format="$name" 
  separator=" &#187; " 
  recurse="once"}%
Web2 » Web3 » Topic

include

%BREADCRUMBS{"Web1/Web2/Web3.Topic" 
  format="$name" 
  separator=" &#187; " 
  include="Web(1|3).*"}%
Web1 » Web3

exclude

%BREADCRUMBS{"Web1/Web2/Web3.Topic" 
  format="$name" 
  separator=" &#187; " 
  exclude="Web2"}%
Web1 » Web3 » Topic

Plugin Installation Instructions

  • Download the ZIP file from the Plugin web (see below)
  • Unzip BreadCrumbsPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/BreadCrumbsPlugin.txt  
    lib/TWiki/Plugins/BreadCrumbsPlugin.pm  

  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.

Plugin Info

Plugin Author: TWiki:Main.MichaelDaum
Copyright ©: 2006, MichaelDaum@WikiRing.com
License: GPL (GNU General Public License)
Plugin Version: v0.05
Change History:  
31 Aug 2006: added NO_PREFS_IN_TOPIC; removed commonTagsHandler thus dropping cairo support
08 Aug 2006: fixed topic parents not showing up; don't show non-existing topics
29 Jul 2006: fixed infinit loop when a topic is its own parent topic
28 Jul 2006: initial version; don't add the topic parent 'WebHome' to the path
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.8
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, BreadCrumbsPlugin nn%
Plugin Home: TWiki:Plugins/BreadCrumbsPlugin
Feedback: TWiki:Plugins/BreadCrumbsPluginDev
Appraisal: TWiki:Plugins/BreadCrumbsPluginAppraisal

-- TWiki:Main/MichaelDaum - 31 Aug 2006

Edit | WYSIWYG | Attach | PDF | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.BreadCrumbsPlugin