Extension:BreadCrumbs (Kimon)

Description
Shows a list of visited pages during the user's session. Very useful when you want to know how you arrived wherever you are.

If the page being visited is already on the list, then the list does not grow (no dupes) and if it were a prior page, the list shrinks.

Also, a new user preference is created to allow users to optionally have this feature enabled to them. The new T/F flag is added to the "Misc." tab of the user preferences.

The line with the links is placed at the bottom of the page but, all formatting options can be easily modified by editing the accompanying CSS.

See the bottom of this page for a sample

Bread crumbs: Main Page &gt; Category:All extensions &gt; Extension:BreadCrumbs (Kimon)

Parameters

 * $wgBreadCrumbsDelimiter:Defines the delimiter to use between the individual bread crumbs. The default value is " &gt; ".
 * $wgBreadCrumbsCount:Specifies the number of items to include in the list. Default is 5.

Installation
Follow these steps to install the extension:

1. Create a directory under "extensions" called "BreadCrumbs"

2. Create a new file called "BreadCrumbs.php" in the "BreadCrumbs" directory. Paste the following code:

3. Create a new file called "BreadCrumbs.css" in the "BreadCrumbs" directory. Paste the following code:

4. Append this line of code to the end of your LocalSettings.php

5. Activate the breadcrumb in your user preferences ("Misc" tab, checkbox "Use breadcrumbs")

Alternative style
If you prefer a grey background rather than yellow, and to position it at the top rather than bottom of the page, then try this CSS instead in step 3:

Workaround for MediaWiki v1.16 and beyond
Special:Preferences has been changed in MediaWiki v1.16. To get the extension to work, delete or comment out this snippet from BreadCrumbs.php. It will now work, but it will appear for all users rather than being an option in preferences:

Note: This work-around does not work on v1.16. Commenting/Deleting the above snippet, produces this error:
 * Detected bug in an extension! Hook BreadCrumbs::output failed to return a value; should return true to continue hook processing or false to abort.

--JSingleton 13:35, 1 September 2010 (UTC)


 * This extension does not work in 1.15.3 - either with or without the v1.16 work-around suggestion.

Warning: Parameter 2 to BreadCrumbs::output expected to be a reference, value given in C:\wamp\www\KShop\includes\Hooks.php on line 117 Internal error From KShop Jump to: navigation, search Detected bug in an extension! Hook BreadCrumbs::output failed to return a value; should return true to continue hook processing or false to abort.

Backtrace:

--RaGz 14:40, 1 October 2010 CST
 * 0 C:\wamp\www\KShop\includes\OutputPage.php(565): wfRunHooks('OutputPageParse...', Array)
 * 1 C:\wamp\www\KShop\includes\OutputPage.php(573): OutputPage->addParserOutputNoText(Object(ParserOutput))
 * 2 C:\wamp\www\KShop\includes\OutputPage.php(678): OutputPage->addParserOutput(Object(ParserOutput))
 * 3 C:\wamp\www\KShop\includes\Article.php(870): OutputPage->tryParserCache(Object(Article))
 * 4 C:\wamp\www\KShop\includes\Wiki.php(450): Article->view
 * 5 C:\wamp\www\KShop\includes\Wiki.php(63): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
 * 6 C:\wamp\www\KShop\index.php(116): MediaWiki->initialize(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
 * 1) 7 {main}

Find this line in BreadCrumbs.php and replace it by Works in 1.16.1 with this fix + the "user" fix mentioned at the start of this section.

If you're seeing frameborder=0 as the first breadcrumb
This happens because a loop is iterating one too many times. The simplest fix is to find this:

And change the $i variable to 1 instead of 0 so it looks like this:

Wikis using this extension

 * Klusopedia - A Dutch wiki for Home Improvement and DIY instructions, tips and tricks!