Help choose the location of the 2007 Wikitravel Get-together!

Wikitravel:Breadcrumb navigation Travel Guide

From Wikitravel

Jump to: navigation, search

Wikitravel has a feature to show bread crumb menus under the title of a destination article to show the countries and regions that a destination belongs to. This can make it easier to navigate the site and find bigger or nearby destinations. This page describes how to add a bread crumb menu to a page.

See also: Breadcrumb

Template:IsIn

To add a menu, you need to specify the next larger area that a place is in. For example, Montreal is in Quebec, and Germany is in Central Europe.

To say that a place is in another place, put the "IsIn" template on the page, with the name of the larger place. So, Montreal's guide has a line saying {{isIn|Quebec}}, and Germany's guide has a line {{isIn|Central_Europe}}.

Things to note:

  • The argument to the "IsIn" template must be in URL form. That is, spaces should be replaced by underscore ("_"), and non-ASCII characters must be URL-escaped. It is also case-sensitive. By far the easiest way to make this form of the name is to copy the name from a browser location bar.
  • If there are two "IsIn" lines, the breadcrumb navigation code uses the last one.
  • You only need to specify the immediately next bigger area. Germany is in Europe, but we don't need to add {{isIn|Europe}} to the Germany page, since Central Europe is already marked as being in Europe.
  • Interaction with our caching system is poor. If you change the location of a larger entity, the cached pages for its contained entities are not updated. You can purge them using "action=purge" to cache and re-load the page.
  • Disambiguators won't be shown unless two parts of the hierarchy have the same ambiguous name (see, for example, New York (city)).

Under the covers

The breadcrumb navigation code uses the RDF defined by the IsIn template to determine the geographical hierarchy of a destination. The RDF defines the relationship between two places, and the navigation code reads that relationship.

The code for the RDF extension to MediaWiki is in MediaWiki Subversion.

In other languages