Template:If exists and not redirect
表示
{{#ifexist}}条件文はページが存在するかどうかだけをチェックし、リダイレクトであるかはチェックされませんが、{{If exists and not redirect}}テンプレートは、存在し、空ではなく、リダイレクトではないページを識別するために使用できます。
使い方
[編集]ページが存在する場合 (ウィキペディア):
{{If exists and not redirect|ウィキペディア|true|false}}: true{{#ifexist:ウィキペディア|true|false}}: true
リダイレクトの場合 (wikipedia):
{{If exists and not redirect|wikipedia|yes|no}}: no{{#ifexist:wikipedia|yes|no}}: yes
空のページの場合 (Template:If exists and not redirect/testpage):
{{If exists and not redirect|Template:If exists and not redirect/testpage|yes|no}}: yes{{#ifexist:Template:If exists and not redirect/testpage|yes|no}}: yes
存在しない記事 (存在しない記事):
{{If exists and not redirect|存在しない記事|1|0}}: 0{{#ifexist:存在しない記事|1|0}}: 0
返却値を指定しない場合:
{{If exists and not redirect|ウィキペディア}}: yes{{If exists and not redirect|wikipedia}}:
引数
[編集]| 指定内容 | 既定値 | 説明 | |
|---|---|---|---|
| 項目名 | - | 検査する対象の項目を指定します。 | |
| 返却値(真) | yes | 存在する場合に返す値を指定します。 | |
| 返却値(偽) | (null) | 存在しない場合に返す値を指定します。 |
カテゴリ
[編集]このテンプレートが貼り付けられたページに適用するカテゴリはありません。