Template:IfNotEmpty: Difference between revisions

From Puella Magi Wiki
Jump to navigation Jump to search
(Created page with "<includeonly>{{{{{|safesubst:}}}{{{{{|safesubst:}}}#if:{{{1}}}|/P1|/p2}}|{{{2}}}|{{{3|}}}}}</includeonly><noinclude> This provides a way to check if a value is empty without s...")
 
No edit summary
 
Line 1: Line 1:
<includeonly>{{{{{|safesubst:}}}{{{{{|safesubst:}}}#if:{{{1}}}|/P1|/p2}}|{{{2}}}|{{{3|}}}}}</includeonly><noinclude>
<includeonly>{{{{{|safesubst:}}}{{{{{|safesubst:}}}#if:{{{1}}}|IfNotEmpty/P1|IfNotEmpty/p2}}|{{{2}}}|{{{3|}}}}}</includeonly><noinclude>
This provides a way to check if a value is empty without stripping whitespace from the "then" and "else" text.
This provides a way to check if a value is empty without stripping whitespace from the "then" and "else" text.



Latest revision as of 00:34, 1 January 2023

This provides a way to check if a value is empty without stripping whitespace from the "then" and "else" text.

Comparison:

  • {{IfNotEmpty|x| p | q }} gives " p "
  • {{IfNotEmpty|| p | q }} gives " q "
  • {{#if:x| p | q }} gives "p"
  • {{#if:| p | q }} gives "q"