Template:Ifexist not redirect
Usage
The {{Ifexist not redirect}} template can be used to identify a page which exists, is not blank, and is not a redirect; whereas {{If}} will only check whether the page exists.
Use the format {{Ifexist not redirect|page|return if true|return if false}}
. The 2nd and 3rd parameters are used to define the output of the template if the condition is true or false, respectively. If not defined the default output is "yes" if true and empty if false.
Examples
現有頁面 (Wikipedia:首页):
{{Ifexist not redirect|Wikipedia:首页|true|false}}
: true{{#ifexist:Wikipedia:首页|true|false}}
: true
重定向頁面 (維基百科:主頁):
{{Ifexist not redirect|維基百科:主頁|yes|no}}
: no{{#ifexist:維基百科:主頁|yes|no}}
: yes
空頁面 (Template:Ifexist not redirect/testpage):
{{Ifexist not redirect|Template:Ifexist not redirect/testpage|yes|no}}
: no{{#ifexist:Template:Ifexist not redirect/testpage|yes|no}}
: yes
不存在的頁面 (123456789):
{{Ifexist not redirect|123456789|1|0}}
: 0{{#ifexist:123456789|1|0}}
: 0
內定輸出:
{{Ifexist not redirect|Wikipedia:首页}}
: yes{{Ifexist not redirect|維基百科:主頁}}
:
上述文档嵌入自Template:Ifexist not redirect/doc。 (编辑 | 历史) 编者可以在本模板的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。本模板的子页面。 |