Extension:BreadCrumbs2
BreadCrumbs2 リリースの状態: 安定 |
|
---|---|
実装 | ユーザー インターフェイス, 外装 |
説明 | Provides breadcrumb navigation based on categories |
作者 | Eric Hartwell, Ike Hecht |
メンテナー | YOUR1 |
最新バージョン | 2.1.1 (2020-05-26) |
MediaWiki | 1.29 - 1.39 |
PHP | 5.5+ |
ライセンス | クリエイティブ・コモンズ 表示 3.0 |
ダウンロード | |
例 | MediaWiki.org > Extensions > User interface > BreadCrumbs2 |
|
|
四半期ごとのダウンロード数 | 48 (Ranked 86th) |
translatewiki.net で翻訳を利用できる場合は、BreadCrumbs2 拡張機能の翻訳にご協力ください | |
The BreadCrumbs2 extension generates "breadcrumbs" to help users navigate around your wiki (assuming it has a structure suitable for navigation). Breadcrumbs inserts a single line navigation string before a page's content. A sample breadcrumb for this page is shown in pale yellow above.
For each page the extension can use the categories and/or namespace to:
- Insert a single line navigation string before a page's content
- Highlight the active sidebar link and/or tab
- Change the site logo
- Breadcrumbs use a single line of text to show a page's location in the site hierarchy... Breadcrumbs have always been a secondary navigation aid... All that breadcrumbs do is make it easier for users to move around the site, assuming its content and overall structure make sense.[2]
BreadCrumbs2 is especially useful with skins like GuMax that display the navigation bar as a row of tabs at the top of the page instead of the Discussion/Edit/History tools.
使用法
The breadcrumb data is stored in a page in the MediaWiki namespace, MediaWiki:Breadcrumbs
.
To access the page, either enter "MediaWiki:Breadcrumbs" into the search box on your wiki and click the search icon, or copy and paste the link [[MediaWiki:Breadcrumbs]]
into a page, then open and edit.
The contents are formatted as a wikitext list, with one line per breadcrumb option:
* category name @ breadcrumb wikitext @ tab name @ site logo
Extra blanks between parameters are ignored.
Parameter | Type | Description |
---|---|---|
category name | 必須 | For each line in the list, see if the current page is a member of the category that matches category or the namespace with the same name. |
breadcrumb wikitext | 省略可能 | Text to display in the subtitle with the page name appended |
tab name | 省略可能 | The tab (navigation) bar with the name tab name that matches category is marked as active. |
site logo | 省略可能 | Use a different site logo for this page. (Note: Use this option with care) |
ナビゲーション
The extension inserts a single line navigation string before a page's contents.[3]
For example,
* Hook extensions @ [[Main Page|MediaWiki.org]] > [[:Category:Extensions|Extensions]] >
Generates the following breadcrumb for this page:
MediaWiki.org > Extensions > BreadCrumbs2 |
Note that BreadCrumbs2 uses the first match with the current page's namespace or one of the page's categories. For example, if the Breadcrumbs page contains:
* Navigation extensions @ [[Main Page|MediaWiki.org]] > [[:Category:Extensions|Extensions]] > [[:Category:Navigation extensions|Navigation]] >
* User interface extensions @ [[Main Page|MediaWiki.org]] > [[:Category:Extensions|Extensions]] > [[:Category:User interface extensions|User interface]] >
The breadcrumbs for this page would be MediaWiki.org > Extensions > Navigation > BreadCrumbs2 and not MediaWiki.org > Extensions > User interface > BreadCrumbs2 because the Navigation line comes first.
サイドバー
The active link in the navigation sidebar can be highlighted using the tab name parameter, if specified. This is especially useful with skins like GuMax that display the navigation bar as a row of tabs at the top of the page instead of the Discussion/Edit/History tools.
- Note
- The tab name is compared to the actual text displayed in the sidebar, so it is not language-independent.
Site logo
If the site logo parameter is specified, an alternate image file is used instead of the site default. The path to this image is relative to the root of your wiki.
- Note
- Use this feature with caution so that it doesn't interfere with your site's usability. Subtle changes are good, but dramatic changes can be confusing. If your site needs significantly different look and feel between sections, consider using namespaces and namespace-specific styles and/or DynamicSkin.
ダウンロード
You can download the extension code, in .tar.gz format, via Special:ExtensionDistributor.
You can also download the code directly via Git from the MediaWiki source code repository. From a command line, you can call the following:
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/BreadCrumbs2.git
To view the code online, including version history for each file, go here.
インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のBreadCrumbs2
という名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/BreadCrumbs2 - 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'BreadCrumbs2' );
- 必要に応じて設定します。
- Create a new page called "MediaWiki:Breadcrumbs"
- 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
設定
$wgBreadCrumbs2RemoveBasePageLink
If breadcrumbs are defined for this page, remove the link back to the base page. Defaults to "false
".
$wgBreadCrumbs2HideUnmatched
If no breadcrumbs are defined for this page, show nothing. Defaults to "false
".
Tips, tricks, and hoops
- The breadcrumb list in
MediaWiki:Breadcrumbs
defines all the categories and subcategories used for navigation. - The extension uses the '@' character to delimit parameters instead of '|' as used in MediaWiki:Sidebar. This greatly simplifies the use of conditional templates in the breadcrumb list.
- If some of your users don't like the breadcrumbs, they can hide it with some CSS (see Manual:$wgAllowUserCss):
#breadcrumbs2 {
display: none;
}
Technical details
The breadcrumbs are built from the data page as follows:
- The string '@@@' is stripped from the text to be replaced with '@' before output (since the '@' character is used as a delimiter)
- Pseudo-variables of the form @@VAR@@ are evaluated.
- @@USERID@@: User ID, blank if anonymous
- @@USERGROUPS@@: Comma-delimited list of groups this user belongs to
- Templates and variables in the text are expanded. You can use parser functions like #if: if installed.
- The extension scans each line to find the first match with the current page's namespace or one of the page's categories.
- The remainder of the line is evaluated to set the breadcrumb string, sidebar, and/or logo (see below)
See also
- Extension:JSBreadCrumbs adds a trail of breadcrumbs below the tab bar.
- Extension:GeoCrumbs implements Wikivoyage's breadcrumbs. Breadcrumb navigation shows bread crumb menus under the title of an article to show the countries and regions that a destination belongs to.
References
- ↑ Street signs and Breadcrumbs, Chapter 6, Don't Make Me Think - Steve Krug (summary on Medium.com)
- ↑ 2.0 2.1 Breadcrumb Navigation Increasingly Useful - Jakob Nielsen's Alertbox, April 10, 2007
- ↑ Arbitrary wikitext can be used for the navigation text, though it should be kept to a simple series of links and delimiters.
この拡張機能は以下のウィキ ファーム/ウィキ ホスト/パッケージに含まれています: これは正式な一覧ではありません。 一部のウィキ ファーム/ウィキ ホスト/パッケージは、ここに記載されていなくてもこの拡張機能を含んでいる場合があります。 必ずご利用のウィキ ファーム、ウィキ ホスト、バンドルで確認してください。 |