模板: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|維基百科:主頁}}
: