BreadCrumbsPlugin
Description
This plugin helps you to locate where you are, and shows you how
you can escape from there using breadcrumbs navigation.
Two types of breadcrumb are supported; "location" breadcrumbs, which show you
where you are in the site hierarchy, taking into account topic parent relationships, and "path" breadcrumbs, that simply show you where you have been, but without going in circles.
In a way, location breadcrumbs have always been supported by TWiki using the
META{"parent"}
variable to display the list of parent topics. Since version
4.x TWiki also supports hierarchical subwebs, but the breadcrumbs support of
TWiki does not allow the display of parent webs as part of of the location
breadcrumbs.
Path breadcrumbs show you which topics you visited to reach the current topic. If you revisit a topic you visited earlier, the path is trimmed back to that topic, so it gives you a sort of visual history of where you have been on the site. Path breadcrumbs require that you have session support enabled.
The plugin also gives a great deal of flexibility in deciding which
parts of the breadcrumbs 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 (type="location" only, ignored if type="path") defaults to the current topic
-
type
: "location" (the default) or "path"
-
header
: format string prepended to the output result
-
format
: format string to render one item on the breadcrumbs path (defaults to '[[$webtopic][$name]]')
-
topicformat
: format string for any topic items on the path; for example, parent topics. Defaults to the same as format
.
-
footer
: format string appended to the output result
-
separator
: format string to be put between items (defaults to one space char)
-
include
: regular expression that items must match to be part of the path
-
exclude
: regular expression that items must not match to be part of the path
-
recurse
: (type="location" only)can be one or more of the following values (comma separated) to decide 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
)
-
$webtopic
: the full web.topic
of the breadcrumb (twiki syntax)
-
$target
: the full web/topic
of the breadcrumb (url syntax)
-
$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
path
%BREADCRUMBS{type="path"}%
Main WebTopicList AlbertoSimoesLeftBar AlexandraMendes AlexandraSilvaLeftBar AntonioCosta AntonioFerreira CarlosCadinha CarlosDomingues DavE GustavoVasconcelosArnold JacomeCunhaSideBar JoaoAbrantesOliveira JohnTalintyre LaraRodri LdapUsers LerNet LocalLogos LucianoBoesel LuisOliveira LuisPedro LuisPedroMachado NatSkinUserViewTemplate PabloBerdaguerSideBar PatternSkinUserViewTemplate PauloMatos PedroMachado PedroSoares RicardoMartins SergioLopes SolangeLima TWikiGuestLeftBar TWikiGuestSideBar TWikiWebSideBar UserListHeader WebLeftBar WebLinks WebSideBar WebTopicCreator WebIndex WebSearch WebSearchAdvanced Personal.Alcino WebChanges WebNotify WebPreferences WebStatistics DanceList FotoOnze FotoCatorze FotoDez FotoSete FotoNove FotoSeis FotoOito FotoDois FotoTres Alcino? WebTopicList FotoCinco FotoDoze FotoQuatro FotoTreze WebIndex WebSearch WebSearchAdvanced Personal.Claudia WebChanges WebNotify WebPreferences WebStatistics Claudia? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.JFF WebChanges WebNotify WebPreferences WebStatistics JFF? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Jacome WebChanges WebNotify WebPreferences WebStatistics Jacome? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Joao WebChanges WebNotify WebPreferences WebStatistics Joao WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Joost WebChanges WebNotify WebPreferences WebStatistics Joost? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Jorge WebChanges WebNotify WebPreferences WebStatistics Jorge? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.JorgeMendes WebChanges WebNotify WebPreferences WebStatistics JorgeMendes WebTopicList WebIndex WebSearch WebIndex WebSearch WebSearchAdvanced Personal.LSB WebChanges WebNotify WebPreferences WebStatistics LSB? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.MBB WebChanges WebNotify WebPreferences WebStatistics MBB? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Nuno WebChanges WebNotify WebPreferences WebStatistics Nuno? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Olga WebChanges WebNotify WebPreferences WebStatistics Olga? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Pablo WebChanges WebNotify WebPreferences WebStatistics Pablo? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.PedroMartins WebChanges WebNotify WebPreferences WebStatistics PedroMartins WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Tiago WebChanges WebNotify WebPreferences WebStatistics Tiago? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Xana WebChanges WebNotify WebPreferences WebStatistics Xana? WebTopicList WebIndex WebSearch WebSearchAdvanced Personal.Ze WebChanges WebNotify WebPreferences WebStatistics Ze? WebTopicList WebIndex WebNotify WebTopicList WebSearch WebSearchAdvanced Research.Aviacc WebChanges WebNotify WebPreferences WebStatistics Aviacc? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.CROSS WebChanges WebNotify WebPreferences WebStatistics CROSS? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.Digitarq WebChanges WebNotify WebPreferences WebStatistics Digitarq? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.Doutoramentos WebChanges WebNotify WebPreferences WebStatistics Doutoramentos? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.EVOLVE WebChanges WebNotify WebPreferences WebStatistics EVOLVE? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.FATBIT WebChanges WebNotify WebPreferences WebStatistics FATBIT? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.IKF WebChanges WebPreferences WebStatistics IKF? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.LerNet WebChanges WebNotify WebStatistics LerNet? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.MONDRIAN WebChanges WebNotify WebPreferences WebStatistics MONDRIAN? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.MathIS WebChanges WebNotify WebPreferences WebStatistics MathIS? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.Matisse WebChanges WebNotify WebPreferences WebStatistics Matisse? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.NASONI WebChanges WebNotify WebPreferences WebStatistics NASONI? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.OntXQuery WebChanges WebNotify WebPreferences WebStatistics OntXQuery? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.PCVIA WebChanges WebNotify WebPreferences WebStatistics PCVIA? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.PURe WebChanges WebNotify WebPreferences WebStatistics PURe? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.QAIS WebChanges WebNotify WebPreferences WebStatistics QAIS? WebTopicList WebIndex WebSearch WebSearchAdvanced Research.Rescue WebChanges WebNotify WebPreferences WebStatistics Rescue? WebTopicList WebIndex WebSearch WebIndex WebSearch WebSearchAdvanced Research.Voda WebChanges WebNotify WebPreferences WebStatistics Voda? WebTopicList WebIndex WebSearch Sandbox WebTopicList WebIndex WebIndex BulkRegistration SitePermissions SpreadSheetPlugin BreadCrumbsPlugin
breadcrumbs to a non-existent location
%BREADCRUMBS{
"Web1/Web2/Web3.Topic"
format="$name"
separator=" » "}%
Web1 » Web2 » Web3 » Topic
recurse="off"
%BREADCRUMBS{
"Web1/Web2/Web3.Topic"
format="$name"
separator=" » "
recurse="off"}%
Web3 » Topic
recurse="once"
%BREADCRUMBS{"Web1/Web2/Web3.Topic"
format="$name"
separator=" » "
recurse="once"}%
Web2 » Web3 » Topic
include
%BREADCRUMBS{"Web1/Web2/Web3.Topic"
format="$name"
separator=" » "
include="Web(1|3).*"}%
Web1 » Web3
exclude
%BREADCRUMBS{"Web1/Web2/Web3.Topic"
format="$name"
separator=" » "
exclude="Web2"}%
Web1 » Web3 » Topic
Plugin Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.
Like many other TWiki extensions, this module is shipped with a fully automatic installer script written using the BuildContrib.
- If you have TWiki 4.1 or later, you can install from the
configure
interface (Go to Plugins->Find More Extensions)
- The webserver user has to have permission to write to all areas of your installation for this to work.
- If you have a permanent connection to the internet, you are recommended to use the automatic installer script
- Just download the
BreadCrumbsPlugin_installer
perl script and run it.
- Notes:
- The installer script will:
- Automatically resolve dependencies,
- Copy files into the right places in your local install (even if you have renamed data directories),
- check in new versions of any installed files that have existing RCS histories files in your existing install (such as topics).
- If the $TWIKI_PACKAGES environment variable is set to point to a directory, the installer will try to get archives from there. Otherwise it will try to download from twiki.org or cpan.org, as appropriate.
- (Developers only: the script will look for twikiplugins/BreadCrumbsPlugin/BreadCrumbsPlugin.tgz before downloading from TWiki.org)
- If you don't have a permanent connection, you can still use the automatic installer, by downloading all required TWiki archives to a local directory.
- Point the environment variable
$TWIKI_PACKAGES
to this directory, and the installer script will look there first for required TWiki packages.
-
$TWIKI_PACKAGES
is actually a path; you can list several directories separated by :
- If you are behind a firewall that blocks access to CPAN, you can pre-install the required CPAN libraries, as described at http://twiki.org/cgi-bin/view/TWiki/HowToInstallCpanModules
- If you don't want to use the installer script, or have problems on your platform (e.g. you don't have Perl 5.8), then you can still install manually:
- Download and unpack one of the
.zip
or .tgz
archives to a temporary directory.
- Manually copy the contents across to the relevant places in your TWiki installation.
- Check in any installed files that have existing
,v
files in your existing install (take care not to lock the files when you check in)
- Manually edit LocalSite.cfg to set any configuration variables.
- Run
configure
and enable the module, if it is a plugin.
- Repeat from step 1 for any missing dependencies.
Plugin Info
--
TWiki:Main/MichaelDaum - 08 May 2007