Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 02:49, 23 February 2025 by Prd (talk | contribs) (Created page with "{{Documentation subpage}} {{lua|Module:Page}} <!-- Categories go at the bottom of this page and interwikis go to Wikidata; thank you! --> This template returns "<code>valid</code>" if the given page title is valid, or the empty string otherwise. The page does not need to exist in order for the template to return "<code>valid</code>". As a convenience, the template treats "<code>-</code>" as an invalid page title. == Usage == <nowiki>{{#if: {{{1|}}} | {{#if:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This template returns "valid" if the given page title is valid, or the empty string otherwise. The page does not need to exist in order for the template to return "valid". As a convenience, the template treats "-" as an invalid page title.

Usage

{{#if:
   {{{1|}}} |
   {{#if:
     {{Is valid page name|{{{1}}}}} |
     [[{{{1}}}]] |
     {{{1}}}
   }}
 }}

Examples

  • {{Is valid page name|Main Page}} returns "valid"
  • {{Is valid page name|[[Main Page]]}} returns ""
  • {{Is valid page name|This page could not POSSIBLY exist, could it?}} returns "valid"
  • {{Is valid page name|-}} returns "" (even though "-" can exist)
  • {{Is valid page name}} returns ""

See also