Wikivoyage:Breadcrumb navigation

Wikivoyage has a feature to show breadcrumb 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 breadcrumb menu to a page.

When to use
Breadcrumb navigation should be used for all destination articles. Travel topics and itineraries have separate breadcrumb trails.

Template:IsPartOf
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, and Germany's guide has a line.

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 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).
 * See also Geographical hierarchy

Template:PartOfTopic
For Travel topics breadcrumbs can be added using the PartOfTopic template.

Template:PartOfItinerary
For Itineraries breadcrumbs can be added using the PartOfItinerary template.

Subpages
Subpages are commonly used for districts of huge cities. In this case 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.

Categories
The breadcrumb at the top of the page allows you to walk up the trail to larger regions.

To browse to places in the same region or down the trail to smaller places, use the category at the bottom of the page – to see this, your Preferences (Appearance) must be set to show hidden categories. The name of the category is the name in the isPartOf template. If the category does not exist, a small link will be created at the bottom of the page to assist in creating the category with the correct content. See Region categories.

Troubleshooting

 * If the breadcrumb menu doesn't show up at all,
 * Be sure that there is an IsPartOf template in the article and a pagebanner at the top of the article.
 * Be sure that there isn't another isIn or IsPartOf in the article text (this is occasionally a source of broken breadcrumbs)
 * 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.
 * If there's only a partial GeoCrumbs trail, (such as "Orange County > Beaches > Some town" instead of "North America > USA > California > Orange County CA > Beaches > Some town"), check the first region listed in the crumb trail to verify that article has the "isPartOf" tag. If Orange County is a disambiguation page, it will have no tags so the trail goes cold. If there's a redirect as an isPartOf target, that redirect (and not just the other page to which it is redirected) must have "isPartOf" to continue the trail.

Under the covers
The crumbs are generated by mw:Extension:GeoCrumbs.

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.

GeoCrumbs are based on a tree structure and presume that each destination or region isPartOf only one parent region. This requires workarounds for places which fall on regional boundaries:
 * Russia and Turkey are tagged isPartOf Europe, although most of the land of both is in Asia.
 * Niagara Falls, Kansas City and Sault Ste Marie each have two separate articles for the places on each side of the border. Some also have a disambiguation page.
 * Some areas that span borders &mdash; e,g. Nogales, Bactria, the Ferghana Valley or National Capital Region (Canada) &mdash; are tagged extraregion. These are breadcrumbed to the "least common multiple", the smallest region containing all the parts - even if that's a point high in the hierarchy like North America
 * Rural areas like Thousand Islands (many are parkland, cottages or vacant) or Glenrio (a ghost town) are left undivided if too small to be two articles.

If there are two or more "isPartOf" tags on an article, the extension ignores all but the last tag. There are no automated tools to verify which places are part of a region; links generated as part of the breadcrumb trail are not displayed by special:whatlinkshere.

The open source code for the extension is available from Wikimedia's git version control system.

See also: Wikipedia article on breadcrumb navigation