మూస:isValidPageName/doc

విక్షనరీ నుండి
Jump to navigation Jump to search
Edit-copy green.svg Documentation for మూస:isValidPageName. [edit]
This page contains usage information, categories, interwiki links and other content describing the template.

Usage[<small>మార్చు</small>]

Returns "valid" if the first parameter is a valid pagename, otherwise the empty string.

This template is only to be used in other templates, mainly headword-line and inflection-table templates to allow wikilinking as default, but to allow several separate wikilinks when this is appropriate. The following is an example with {{en-noun}} on octopus:

In {{en-noun}}:

{{#if:{{{1|}}}|{{#if:{{isValidPageName|{{{1}}}}}|[[{{{1}}}]]|{{{1}}}}}}}

This means that there is an automatic wikilink when {{{1}}} is a valid page name, but no wikilink when {{{1}}} is not a valid page name. In Octopus:

{{en-noun|''plural'' '''[[octopuses]]''', '''[[octopodes]]''' or '''[[octopi]]'''}}

Which appears as:

octopus (plural octopuses, octopodes or octopi)

Without isValidPageName:

octopus (plural [[octopuses, octopodes or octopi]])

This works because the string [['''[[octopuses]]''', '''[[octopodes]]''' or '''[[octopi]]''']] is not a valid page name, due to the square brackets.