Difference between revisions of "Template:Ifpreview/doc"

From blackwiki
Jump to navigation Jump to search
imported>Daask
(Move content from Template:Ifpreview - See that page history for attribution)
 
imported>Daask
(Add Usage examples)
Line 4: Line 4:
 
This template returns the <code>then</code> parameter if it is included in an ''editing preview'', else it returns the <code>else</code> parameter if it is included in a ''saved page''. This can be useful for giving instructions to editors before they save the page, without those instructions cluttering the saved page if work is done incorrectly.
 
This template returns the <code>then</code> parameter if it is included in an ''editing preview'', else it returns the <code>else</code> parameter if it is included in a ''saved page''. This can be useful for giving instructions to editors before they save the page, without those instructions cluttering the saved page if work is done incorrectly.
 
== Usage ==
 
== Usage ==
−
 
+
* {{tlx|ifpreview|{{tlg|error|This error message will only be shown in previews}}}}
 +
* {{tlx|ifpreview|Show this in previews|Show this on published pages, but not in previews}}
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
 
[[Category:If-then-else templates]]
 
[[Category:If-then-else templates]]
 
}}</includeonly>
 
}}</includeonly>

Revision as of 04:27, 28 March 2018

Description

This template returns the then parameter if it is included in an editing preview, else it returns the else parameter if it is included in a saved page. This can be useful for giving instructions to editors before they save the page, without those instructions cluttering the saved page if work is done incorrectly.

Usage

  • {{ifpreview|{{error|This error message will only be shown in previews}}}}
  • {{ifpreview|Show this in previews|Show this on published pages, but not in previews}}