WikiDrops

From Extension Collaborative Wiki

Jump to: navigation, search

Contents

Introduction

Using MediaWiki as a content management system (CMS) has some advantages and disadvantages. The pros are wonderful: simple syntax, flexible, community review and editing; however, there are some cons. Perhaps the largest is providing some hierarchy to a system that lends itself to organized chaos.

The Problem

There is no built-in navigation that tells the user where they are (or have been) in MediaWiki. There are some techniques that can be employed to help guide users (eg. menu templates); however, user feedback tells us more is required.

A Solution

WikiDrops -- a breadcrumb style menu created to assist the user with navigation. This is actually part of a larger solution that will tackled at the design level -- other assistance will be category based menus and the like.

Methodology

Breadless Crumbs

Whether a user starts at a home page, or lands at some obscure content area following a link from a search engine, the breadcrumb problem is the same when content has a very loose structure.

The Algorithm

The initial WikiDrops algorithm is based on the inbound link counts: The pages linking to the requested (current) page are examined to find the page with the most inbound links. That page is then chosen as the parent to the current page. The algorithm proceeds recursively until the home page is reached.

Assumptions

  1. MediaWiki content inbound link statistics are similar for different content models

It has already been shown that the current algorithm does not work for all wiki usage models. We welcome input to extend or provide alternate breadcrumb algorithms.

Side Affects

Since WikiDrops is coded as a Parser Hook, it is executed every time the global MediaWiki parser object is invoked. For most pages, this is OK. When using extensions like gallery or calendar, the breadcrumbs may show-up somewhere else on the page.

I'm considering adding a config option to use a page tag; and probably will as time allows.

Implementation

A MediaWiki extension has been created and made available.

Get your WikiDrops!

  • browse source
  • svn checkout https://sourcecode.extension.org/svn/MediaWiki/WikiDrops/trunk

Installation

Just include WikiDrops.php to your LocalSettings.php file.

Configuration

Defaults

Name of the top level home page.

  define('WD_MAIN_PAGE', 'Main Page');

Styling

The default div id for WikiDrops output is now breadcrumbs. The div id used by the standard MW output is contentSub; to style them the same, you will need to modify the style sheet for your theme.

Technically, id's should be unique in an XHTML document. If you wish to restore the standard behaviour, you can add the following to your settings file before WikiDrops is included:

 define('WD_DIV_ID', 'contentSub');

For styling, instead of relying on the id, the class 'subpages' and 'breadcrumbs' may also be used.

You can also specify the character string used to seperate the crumbs, this shows the default:

  define('WD_SEPARATOR', ' < ');

And change how the current page is represented in the list, this shows the default:

  define('WD_CURRENT_PAGE_STYLE_OPEN', '<strong>');
  define('WD_CURRENT_PAGE_STYLE_CLOSE', '</strong>');

Algorithm Tweaks

You can try this to see if you get better crumb results add the following to your settings file before WikiDrops is included:

  define('WD_WIKI_WITH_FEWER_CROSS_LINK', true);

If you want WikiDrops to ignore pages that are re-directs:

  define('WD_IGNORE_PAGE_REDIRECTS', true);

If you want WikiDrops to ignore User pages:

  define('WD_IGNORE_USER_PAGES', true);

The max recursion depth is set at 7 levels, you may modify this if you dare:

  define('WD_MAXDEPTH', 10);

Releases

The latest, greatest and perhaps most broken is always the 'trunk version. For production systems, i would encourage users to use the tagged releases from subversion. The latest tagged releases are generally those in use by this site and others at eXtension.

See Notes below for updates.

Bugs

Anyone is welcome to report bugs to eXtensionBugs@extension.org

patches welcome too :-)

Notes

  • release date - svn_tag - description
  • 2007.02.22 - 0.1.19 - additional config options
  • 2007.01.26 - 0.1.18 - fix for MW 1.9.x releases
  • 2006.08.10 - 0.1.17 - fix for extra <p> tag added by parser
  • 2006.08.09 - 0.1.16 - warning change default div id to breadcrumbs; previously was contentSub. See docs above for changing this.
  • 2006.07.13 - 0.1.15 - new methods to allow WikiDrop object usage outside of default MW page display
  • 2006.06.19 - 0.1.14 - add new CSS selectors
  • 2006.04.27 - 0.1.13 - fix for extensions that abuse OutputPage object
  • 2006.04.25 - 0.1.12 - no longer called by Parser objects, called by OutputPage and SpecialPage objects instead; resolves issues with other extensions that abuse the main parser object (WikiCalendar, Cite, etc.)
  • 2006.04.19 - 0.1.11 - bug fix for parser check, add new option to change name of 'Main Page'
Personal tools