Template:Random subpage
表示
| Luaモジュールを使用しています: |
Template layout
[編集]{{Random subpage}}
or
{{Random subpage|page=<page name>|start=<number>|end=<number>|same=<number>}}
or
{{Random subpage|<page name>|<number>|<number>|<number>}}
Usage
[編集]This template transcludes a numbered sub-page that is randomly selected between the "start"-numbered sub-page and the "end"-numbered sub-page as follows:
{{<page name>/<randomly selected number between "start" and "end">}}
It may be used with or without parameters as follows:
- 1|page: The name of the page to be displayed (without the subpage number). The default is empty.
- 2|start: The starting sub-subpage number. Must be a positive integer. The default is 1.
- 3|end: The ending sub-subpage number. Must be a positive integer. The default is 2.
- 4|same: (optional) This parameter makes different template invocations link to the same subpage. It can be set with
|same=yes,|same=y,|same=trueor|same=1. For it to work, the|same=parameter must be set on all desired templates on a page, and those templates must also use the samestartandendvalues. The subpage chosen will change randomly if the page is edited or purged.
Note: this template used to accept a |seed= parameter, but this has been deprecated after the template was switched to use Module:Random.
Example
[編集]This template can be used to display a list of randomly selected items from a group of numbered subpages. For example, portals that use "Did you know..." sections can randomly display four items from a page named "Portal:Foo/Did you know" that has sixteen numbered subpages as follows:
{{Random subpage|page=Portal:Foo/Did you know|start=1|end=4}}
{{Random subpage|page=Portal:Foo/Did you know|start=5|end=8}}
{{Random subpage|page=Portal:Foo/Did you know|start=9|end=12}}
{{Random subpage|page=Portal:Foo/Did you know|start=13|end=16}}
関連テンプレート
[編集]ポータルページの特集コンテンツ用
- {{Transclude random subpage}}—特集サブページをランダムに読み込む。ボックスなし。
- {{Random portal component}}—特集サブページをランダムに読み込む。ボックス付き。
- {{Random subpage}}—各種サブページをランダムに読み込む。ボックスなし。
- {{Numbered subpages}}—管理用。通し番号が振られたサブページを一覧表示し比較しやすくしたもの。
ポータルページの特集サブページ用
ポータルページのレイアウト用
- {{Box-header}}—既定では長方形のボックス形式のヘッダ。文字・背景・線・余白のスタイル、編集リンクなどのレイアウト指定を行う。
- {{Box-header colour}}—配色を自動計算し、細かな指定が不要なヘッダ
- {{Box-header-round}}—ボックスの角が丸いヘッダ
- {{Box-header-watch}}—ウォッチリストへの追加アイコンをもつヘッダ
- {{Box-header-style1}}—タイトル左寄せのヘッダ
- {{Box-footer}}—ボックス形式のフッタ。Box-headerと必ずセットで使う。
- {{ウィキポータルボックスヘッダ}} & {{ウィキポータルボックスフッタ}}—長方形のボックス形式のヘッダ&フッタ
- Portal:Box-header & Portal:Box-footer—(旧式)長方形のボックス形式のヘッダ&フッタ。Box-headerの古いCSSスタイルを使用。
- {{標準コラム}}—(旧式)ボックスの角が丸いヘッダで、アイコン使用にも対応
- {{影付コラム}}—(旧式)長方形で影付きのボックス形式のヘッダ
- {{コラム}}—(旧式)タイトル下方に色付き線を表示するシンプルな見た目のヘッダ
- {{Flex columns}}—左右2列のレイアウト用
関連ポータル等への案内リンク用
- {{ウィキポータルリンク}}({{Portal}})—右寄せボックス、任意画像または自動アイコン、背景水色または灰色—主に記事、カテゴリ用
- {{Portal box}}—右寄せボックス、アイコンなし、背景水色—主に記事、カテゴリ用
- {{Portal bar}}—横長全幅ボックス、自動アイコン、文字アイコンやや小さめ—主に記事、カテゴリ、ポータル用
- {{Portal-inline}}—左寄せボックスなし、文字アイコン小さめ表示にも対応—主に記事、テンプレート内表示用
- {{Related portals}}—左寄せボックス、自動アイコン、アイコンやや大きめ—主にポータル用
- {{Related portals2}}—左寄せボックス、自動アイコン、アイコン大きめ、2段表示—主にポータル用
- {{WikimediaForPortals}}—姉妹プロジェクトへの案内リンク
汎用
- {{Portals}}—ポータル制度の簡易案内
- {{Purge page}}—サーバーのキャッシュ破棄リンク