维基导游:面包屑导航

本页使用了标题或全文手工转换
来自维基导游


维基导游有在目的地标题下显示面包屑导航的功能,用来限制地点的归属。

示例: 欧洲 > 俄罗斯 > 南俄罗斯 > 北高加索 > 达吉斯坦

这样可以更方便地浏览网站,找到上级的或附近的其他目的地。本页面介绍如何给页面添加一个面包屑导航条。

何时使用[编辑]

所有目的地条目中都应该有面包屑导航。不过却不应该用到旅行路线中,就算该路线属于某个地理区域。

要添加一个面包屑导航你需要指定一个上级地点。举个例子,就好比蒙特利尔属于魁北克德国位于中欧

要说明一个地方位于另一个,就在页面底部加入{{isPartOf}}模板,并填入大一级的地方作为参数。所以,蒙特利尔的旅行指南条目中有一行代码是{{isPartOf|魁北克}},德国条目中有{{isPartOf|中欧}}。

按照惯例,该模板被放置页面的底部。

  • 如果放置了两个“IsPartOf”,面包屑导航的代码只会使用后一个。
  • 你只需指定临近的一个地方。德国属于欧洲,但我们不用在德国的页面中添加{{isPartOf|欧洲}},因为中欧的页面中已经注明了其属于欧洲。
  • 缓存系统的交互性较差。如果你改动了一个地方的位于参数,缓存将不会更新。你需要用“action=purge”(刷新缓存)来重载页面
  • 消歧义页不会显示面包屑导航除非两个更大的层级拥有相同的名字(如,东京)。

旅行话题页面的面包屑导航可以通过添加{{PartOfTopic}}模板来显示。

子页面[编辑]

特大城市条目中经常会用到子页面。这种情况下面包屑导航会默认假定子页面属于父页面。例如北京/西城默认是北京的子区域。

不过如果省略了模板的话,就不会产生isPartOf关系的RDF

分类[编辑]

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.

The category is the same name as the region places in the isPartOf template. Note 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.

故障排除[编辑]

  • 如果面包屑选单完全不能呈现时,
    • 可以肯定是已有存放一个IsPartOf模板中的条目
    • 可以肯定的是没有在条目的文字有另一isIn或IsPartOf(这就是偶然的破碎的面包屑导航之来源)
  • 如果您更改了文章或其父级的IsPartOf设置,但面包屑菜单仍显示旧内容,则缓存的IsPartOf信息可能不正确。通过“清除缓存”修复此问题。您必须对更改后的每篇文章执行此操作,直至当前文章。从改变过的文章的IsPartOf文章开始,然后解决所有IsIn文章,等等(如果更改顶级文章的IsPartOf关系,可能会有很多缓存要清除)。
    • 您可以通过单击文章的“历史记录”选项卡,在“历史记录”页面和浏览器的位置(URL)栏中清除缓存,找到字符串“action=history”,并将其更改为“action=purge”,然后按Enter键,给出没有面包屑菜单的文章视图;3)单击Article选项卡,为文章提供正确的breadcrumb菜单。
    • 您也可以编辑文章,然后单击页面底部的清除缓存链接。
  • 如果只有部分GeoCrumbs路径,(例如“橙县>海滩>某些城镇”而不是“北美>美国>加利福尼亚>加州奥兰治县>海滩>某些城镇”),请查看面包屑中列出的第一个区域跟踪以验证该文章是否具有“isPartOf”标记。如果Orange County是一个消歧页面,它将没有标签,因此线索变冷。如果有一个重定向作为isPartOf目标,那么该重定向(而不仅仅是重定向的另一个页面)必须具有“isPartOf”才能继续跟踪。

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:

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.

参见: Wikipedia article on breadcrumb navigation