Help Wikitravel grow by contributing to an article! Learn how.
New users, please see Help or go to the Pub to ask questions.

Wikitravel:Breadcrumb navigation

From Wikitravel
Revision as of 02:47, 7 November 2011 by Inas (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Example: Europe : Russia : Southern Russia : North Caucasus : Dagestan

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.

When to use[edit]

Breadcrumb navigation should be used for all destination articles. It should not be used for itinerary articles or travel topics, even if they are located within a geographical area.

Template:IsPartOf[edit]

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 "isPartOf" template at the bottom of the page, with the name of the larger place. So, Montreal's guide has a line saying {{isPartOf|Quebec}}, and Germany's guide has a line {{isPartOf|Central Europe}}.

By convention, this template is placed at the end of the destination article.

  • If there are two "IsPartOf" lines, the breadcrumb navigation code only 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 {{isPartOf|Europe}} to the Germany page, since Central Europe is already marked as being in Europe.
  • Interaction with the 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, Tokyo).

Template:IsIn[edit]

The use of the IsIn template is deprecated. Use IsPartOf instead.

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.

Subpages[edit]

Subpages are commonly used for districts of huge cities. In this case the the breadcrumb navigation assumes that the subpage lies within the parent page. For instance the article London/Westminster is recognised as a sub-region of London.

However if the template is omitted, no RDF will be generated for the isPartOf relationship.

Troubleshooting[edit]

  • If the breadcrumb menu doesn't show up at all,
    • Be sure that there is an IsPartOf template in the article
    • Be sure that there isn't another isIn or IsPartOf in the article text (this is occasionally a source of broken breadcrumbs)
    • Be sure that the article name is in URL form if using the IsIn template, or just switch to the IsPartOf template. See above for the URL form rules. By far the easiest way to make this form of the name is to copy the name from a browser location bar.
  • If you've changed the IsPartOf setting for an article, or its parent, but the breadcrumb menu still shows the old contents, then likely the cached IsPartOf information is incorrect. Fix this by purging the cache. You must do this with every article below the one which changed, down to the current article. Start with articles which are IsPartOf to the changed article, and work down to all articles which are IsIn them, and so on. (If you change the IsPartOf relationship of a top-level article, there can be a lot of caches to purge!).
    • You can purge the cache by clicking on the History tab of the article, giving the History page and in the browser's location (URL) bar, find the string "action=history", and change it to "action=purge", then push the Enter key, giving a view of the article with no breadcrumb menu; 3) click on the Article tab, giving the article with a correct breadcrumb menu.
    • You can also edit the article, and click on the Purge cache link at the bottom of the page.

Under the covers[edit]

The breadcrumb navigation code uses the RDF isPartOf relation defined by the IsPartOf template to determine the geographical hierarchy of a destination. The RDF defines the relationship between two places, and the navigation code reads that relationship. An exception to this occurs when using subpages. Subpages are commonly used for districts of huge cities. In this case the template and associated RDF are ignored, and the breadcrumb navigation assumes that the subpage lies within the parent page.

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

See also: Wikipedia article on breadcrumb navigation

Variants

Actions

Destination Docents

In other languages