Difference between revisions of "Template:ExistNotRedirect/doc"

From blackwiki
Jump to navigation Jump to search
imported>BrownHairedGirl
(Created page with '{{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> {{L...')
 
imported>BrownHairedGirl
(done)
Line 2: Line 2:
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
{{Lua|Module:ExistNotRedirect}}
 
{{Lua|Module:ExistNotRedirect}}
 +
Checks whether a page exists and is not a redirect.
 +
 +
If the pagename both exists AND is not a redirect, it returns the pagename.
 +
 +
Otherwise, it returns a blank
 
== Usage ==
 
== Usage ==
 +
: '''{{tlx|ExistNotRedirect | pagename}}'''
 +
 +
'''Parameters:'''
 +
* One page name
 +
;Examples
 +
# A page which exists:<br /><code><nowiki>{{ExistNotRedirect|Japan}}</nowiki></code> → {{ExistNotRedirect|Japan}}
 +
# A page which does not exist:<br /><code><nowiki>{{ExistNotRedirect|The exciting story of paint drying in a small town in Japan one day in April 1927}}</nowiki></code> → {{ExistNotRedirect|The exciting story of paint drying in a small town in Japan one day in April 1927}}
 +
# Another page which exists:<br /><code><nowiki>{{ExistNotRedirect|Portal:History}}</nowiki></code> → {{ExistNotRedirect|Portal:History}}
 +
# A page which does not exist:<br /><code><nowiki>{{ExistNotRedirect|Portal:Computing in 1066}}</nowiki></code> → {{ExistNotRedirect|Portal:Computing in 1066}}
 +
# A page which exists, but is a rediect:<br /><code><nowiki>{{ExistNotRedirect|Portal:Idaho}}</nowiki></code> → {{ExistNotRedirect|Portal:Idaho}}
  
  

Revision as of 18:02, 9 July 2019

Checks whether a page exists and is not a redirect.

If the pagename both exists AND is not a redirect, it returns the pagename.

Otherwise, it returns a blank

Usage

{{ExistNotRedirect | pagename}}

Parameters:

  • One page name
Examples
  1. A page which exists:
    {{ExistNotRedirect|Japan}}
  2. A page which does not exist:
    {{ExistNotRedirect|The exciting story of paint drying in a small town in Japan one day in April 1927}}
  3. Another page which exists:
    {{ExistNotRedirect|Portal:History}}
  4. A page which does not exist:
    {{ExistNotRedirect|Portal:Computing in 1066}}
  5. A page which exists, but is a rediect:
    {{ExistNotRedirect|Portal:Idaho}}