Difference between revisions of "Template:Ifwp"

From HeRO Wiki
Jump to: navigation, search
(Added usage instructions.)
m
 
Line 9: Line 9:
 
* If parameter 1 is defined and not empty, parameter 2 will be returned.
 
* If parameter 1 is defined and not empty, parameter 2 will be returned.
 
* If parameter 1 is defined and empty, parameter 3 will be returned.
 
* If parameter 1 is defined and empty, parameter 3 will be returned.
* If parameter 1 is not defined at all, <nowiki>{{{1}}}</nowiki> will be returned.
+
* If parameter 1 is not defined at all, <nowiki>{{{1}}}</nowiki> will be returned. (This should be avoided.)
  
 
This template is best used in other templates that can specify the default parameters in their usage documentation, such that parameter 1 is always defined, even if it's empty.
 
This template is best used in other templates that can specify the default parameters in their usage documentation, such that parameter 1 is always defined, even if it's empty.

Latest revision as of 02:59, 12 November 2022


This template's code is:

{{{3{{{1|}}}|{{{1{{{1|}}}|{{{2|}}}}}}}}}

Usage

  • If parameter 1 is defined and not empty, parameter 2 will be returned.
  • If parameter 1 is defined and empty, parameter 3 will be returned.
  • If parameter 1 is not defined at all, {{{1}}} will be returned. (This should be avoided.)

This template is best used in other templates that can specify the default parameters in their usage documentation, such that parameter 1 is always defined, even if it's empty.

See Template:Ifwp on meta.wikimedia.org