Jump to content

Wy/si/විකිචාරිකා:Breadcrumb navigation

From Wikimedia Incubator
< Wy | si
Wy > si > විකිචාරිකා: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

[edit | edit source]

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

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).
  • See also Wikivoyage:Geographical hierarchy

For Travel topics breadcrumbs can be added using the {{Wy/si/PartOfTopic}} template.

For Itineraries breadcrumbs can be added using the {{Wy/si/PartOfItinerary}} template.

Subpages

[edit | edit source]

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

[edit | edit source]

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 Wikivoyage:Region categories.

Troubleshooting

[edit | edit source]
  • If the breadcrumb menu doesn't show up at all,
    • Be sure that there is an IsPartOf template in the article and a {{Wy/si/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

[edit | edit source]

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:

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