Template:Random item/doc

N個のアイテムの中からランダムに1つを返すテンプレートです。

Template:Random item/doc

N個のアイテムの中からランダムに1つを返すテンプレートです。

使い方

以下を貼り付けて使用できます。

{{Random item|item1|item2|...|itemN}}

通常は、ランダムにアイテムを返します。しかし、|same=yを使うと、入力と総数を変えない限り、常に同じアイテムを返します。

引数

  • |1=|2=|N= → 出力として返すアイテムです。
  • |same=y この引数を設定すると、入力と総数を変えない限り、常に同じアイテムを返します。
  • (注:英語版の古いバージョンには|range=パラメータがありましたが、いまは不要になりました。翻訳の際はご留意ください。)

このテンプレートが貼り付けられたページに適用するカテゴリはありません

出力の例

上3つは出力がランダムであること、下3つは出力が常に同じであることを示します。キャッシュを破棄すると、その度に上3つは変わります。

  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4}} → 1
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4}} → b
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4}} → c
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} → 4
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} → 4
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} → 4

実際の使用例

ランダム表示の類例

ポータルの特集記事・画像などをランダム表示するために、ほかのテンプレートなども使われています。

関連項目

ポータルページの特集コンテンツ用

  • {{Transclude random subpage}}—特集サブページをランダムに読み込む。ボックスなし。
  • {{Random portal component}}—特集サブページをランダムに読み込む。ボックス付き。
  • {{Random subpage}}—各種サブページをランダムに読み込む。ボックスなし。
  • {{Numbered subpages}}—管理用。通し番号が振られたサブページを一覧表示し比較しやすくしたもの。
  • {{Random item}}—コンテンツをランダムに読み込む。

ポータルページの特集サブページ用

ポータルページのレイアウト用

関連ポータル等への案内リンク用

  • {{ウィキポータルリンク}}({{Portal}})—右寄せボックス、任意画像または自動アイコン、背景水色または灰色—主に記事、カテゴリ用
  • {{Portal box}}—右寄せボックス、アイコンなし、背景水色—主に記事、カテゴリ用
  • {{Portal bar}}—横長全幅ボックス、自動アイコン、文字アイコンやや小さめ—主に記事、カテゴリ、ポータル用
  • {{Portal-inline}}—左寄せボックスなし、文字アイコン小さめ表示にも対応—主に記事、テンプレート内表示用
  • {{Related portals}}—左寄せボックス、自動アイコン、アイコンやや大きめ—主にポータル用
  • {{Related portals2}}—左寄せボックス、自動アイコン、アイコン大きめ、2段表示—主にポータル用
  • {{WikimediaForPortals}}—姉妹プロジェクトへの案内リンク

汎用

  • {{Portals}}—ポータル制度の簡易案内
  • {{Purge page}}—サーバーのキャッシュ破棄リンク


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.