Template:Is valid page name/sandbox
Jump to navigation
Jump to search
| File:Edit In Sandbox Icon - Color.svg | This is the template sandbox page for Template:Is valid page name (diff). See also the companion subpage for test cases. |
File:Test Template Info-Icon - Version (2).svg Template documentation[view] [edit] [history] [purge]
| Warning | This template is used on approximately 3,200 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| File:Lua-Logo.svg | This template uses Lua: |
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
[edit source]{{#if:
{{{1|}}} |
{{#if:
{{Is valid page name|{{{1}}}}} |
[[{{{1}}}]] |
{{{1}}}
}}
}}
Examples
[edit source]{{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
[edit source]- {{isValidPageName}} at the English Wiktionary