「テンプレート:Template sandbox notice」の版間の差分
提供: Yourpedia
								
												
				|  (ウィキメディアのバグに対応) | |||
| 1行目: | 1行目: | ||
| <noinclude>----<!-- white space check --> | <noinclude>----<!-- white space check --> | ||
| </noinclude>{{ | </noinclude>{{ | ||
| − | + |    #ifeq: {{SUBPAGENAME}} | {{{subpage-name|sandbox}}} | |
| − | + |    |<!-- the sandbox -->{{Ombox | |
| − |    |<!-- the sandbox --> | + | | image-file = Bucket_in_the_sand.svg | 
| − | + | | text = ここは、[[{{NAMESPACE}}:{{BASEPAGENAME}}]]の[[Wikipedia:テンプレートのサンドボックスとテストケース|テンプレート・サンドボックス]]です。{{ | |
|    #ifexist: {{ #rel2abs: ../testcases }} |    #ifexist: {{ #rel2abs: ../testcases }} | ||
| − |    | <br/>対応する[[ | + |    |<br/>対応する[[../testcases|テストケース・サブページ]]もご覧ください。 | 
| − | }} | + | }}}}{{{notice-for-sandbox|<noinclude>{{notice| text = notice-for-sandbox }}</noinclude>}}}{{ | 
|      #ifeq: {{NAMESPACE}} | {{ns:10}} |      #ifeq: {{NAMESPACE}} | {{ns:10}} | ||
|      |<includeonly>[[Category:テンプレート・サンドボックス|{{PAGENAME}}]]</includeonly> |      |<includeonly>[[Category:テンプレート・サンドボックス|{{PAGENAME}}]]</includeonly> | ||
|    }} |    }} | ||
| − |    |<!-- not sandbox -->{{{notice-not-sandbox|<noinclude>{{ | + |    |<!-- not sandbox -->{{{notice-not-sandbox|<noinclude>{{notice| text = notice-not-sandbox }}</noinclude>}}} | 
| }}<noinclude> | }}<noinclude> | ||
| − | ----<!-- white space check --> | + | ---- | 
| − | {{Documentation}}<!--   | + | |
| + | <!-- white space check --> | ||
| + | {{Documentation}}<!-- | ||
|    Add categories and inter-wikis to the /doc subpage, not here! |    Add categories and inter-wikis to the /doc subpage, not here! | ||
| --></noinclude> | --></noinclude> | ||
2011年9月23日 (金) 23:08時点における版
{{
#ifeq: Template sandbox notice | sandbox |
| notice | ここは、テンプレート:Template sandbox noticeのテンプレート・サンドボックスです。{{  #ifexist: {{ #rel2abs: ../testcases }}
 | 対応する[[../testcases|テストケース・サブページ]]もご覧ください。 }} | [[画像:|040px|image]] | 
| notice-for-sandbox | 
#ifeq: テンプレート | テンプレート | }}|
| notice-not-sandbox | 
}}
このテンプレートは、テンプレートのサンドボックスの告知を行います。
目次
使い方
基本
次のコードを、サンドボックスの冒頭に貼り付けます(場合によってはテンプレート本体にも貼り付けます):
<noinclude>
{{Template sandbox notice}}
</noinclude><!-- ここにテンプレートのコードを記入 -->
告知の切り替え
次のパラメータでの告知の内容を切り替えられます:
<noinclude>
{{
  Template sandbox notice
  | notice-for-sandbox={{ambox|text=ここはサンドボックス|type=notice}}
  | notice-not-sandbox={{ambox|text=ここは非サンドボックス|type=content}}
}}
<!-- サンドボックスと非サンドボックスを区別しない告知はここに記入 -->
</noinclude><!-- ここにテンプレートのコードを記入 -->
保護されたテンプレートの例
次のコードは、保護の告知を利用しています:
<noinclude>
{{
  Template sandbox notice
  | notice-not-sandbox={{保護}}
}}
</noinclude><!-- ここにテンプレートのコードを記入 -->
テンプレートの説明文・解説を併用した例
このコードは、Help:テンプレートの説明文を併用しています:
<noinclude>
{{Template sandbox notice}}
<!-- 上段の告知はここに記入 -->
</noinclude><!-- ここにテンプレートのコードを記入 --><noinclude>
<!-- 下段の告知はここに記入 -->
{{Documentation}}
<!-- 言語間リンクとカテゴリはここに記入しない(ドキュメントに記入) -->
</noinclude>
上の三つを合わせた例
このコードは、Help:テンプレートの説明文と保護の告知の両方を利用しています:
<noinclude>
{{
  Template sandbox notice
  | notice-for-sandbox={{ambox|text=This is a sandbox.|type=notice}}
  | notice-not-sandbox={{ambox|text=This is elsewhere.|type=content}}
{{半保護}}
}}
<!-- 上段の告知はここに記入 -->
</noinclude><!-- ここにテンプレートのコードを記入 --><noinclude>
<!-- 下段の告知はここに記入 -->
{{ Documentation }}
<!-- 言語間リンクとカテゴリはここに記入しない(ドキュメントに記入) -->
</noinclude>
ただし解説サブページがある場合、テンプレート本体の告知は<includeonly>と</includeonly>を用いて解説サブページに書くことが推奨されます。
パラメータ
| パラメータ | 指定する内容 | 既定値 | 説明 | 
|---|---|---|---|
| subpage-name | サブページ名 | sandbox | サンドボックスとしてのサブページ名を指定します。これは、告知を表示するかどうか、パラメータで指定された告知の選択に影響します。 | 
| notice-for-sandbox | 任意の文章・テンプレート | サブページ名が{{{subpage-name}}}である場合に表示する内容。 | |
| notice-not-sandbox | 任意の文章・テンプレート | サブページ名が{{{subpage-name}}}でない場合に表示する内容。 | 
カテゴリ
このテンプレートは、貼り付けられたページに次のカテゴリを適用します:
| カテゴリ | ソートキー | 
|---|---|
| Category:テンプレート・サンドボックス | {{PAGENAME}} | 
関連項目
{{
#ifeq: Template sandbox notice | sandbox ||
|   | このページはウィキペディア日本語版のコンテンツ・テンプレート:Template sandbox noticeを利用して作成されています。変更履歴はこちらです。 | 
}}


