維基導遊:麵包屑導航

本頁使用了標題或全文手工轉換
出自維基導遊
捷徑:Crumbs


維基導遊有在目的地標題下顯示麵包屑導航的功能,用來限制地點的歸屬。

示例: 歐洲 > 俄羅斯 > 南俄羅斯 > 北高加索 > 達吉斯坦

這樣可以更方便地瀏覽網站,找到上級的或附近的其他目的地。本頁面介紹如何給頁面增加一個麵包屑導航列。

何時使用[編輯]

所有目的地條目中都應該有麵包屑導航。不過卻不應該用到旅行路綫中,就算該路綫屬於某個地理區域。

要增加一個麵包屑導航你需要指定一個上級地點。舉個例子,就好比滿地可屬於魁北克德國位於中歐

要說明一個地方位於另一個,就在頁面底部加入{{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