Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template:If empty/testcases

From Wikipedia, the free encyclopedia
Code Sandbox Current Notes
{{If empty}} Returns an empty string.
{{If empty|one}} one one Returns the first parameter that is defined and not empty.
{{If empty|one|two}} one one
{{If empty|one|two|three|four}} one one
{{If empty||two}} two two The first parameter is empty/undefined, so is passed over.
{{If empty||two|three|four}} two two
{{If empty||two||four}} two two
{{If empty|||||||||nine}} nine nine
{{If empty||||||||||ten}} ten ten Empty string returned if maximum of nine parameters exceeded.
{{If empty|}} The only parameter is empty or undefined, so returns an empty string.
{{If empty||||}} Returns an empty string.
{{If empty|{{{1|}}}|{{{2|}}}|three}} three three
{{If empty|{{{1}}}|{{{2}}}|three}} {{{1}}} {{{1}}} No pipe-characters following the names of the first two parameters ("1" and "2"), so the first of these returned as text ("{{{1}}}").
{{If empty|{{{logo|}}}|two}} two two
{{If empty|{{{logo}}}|two}} {{{logo}}} {{{logo}}} No pipe-character following the parameter name "logo", so the text "{{{logo}}}" returned.
{{If empty|2=x}} Unnamed parameters must be defined sequentially.
{{If empty|p=q}} The template identifies the parameters it receives as parameters 1 to 9, not using names such as "p", etc.
{{If empty|one|{{X1}}[[Category:X1]]}} one one Parameters after the first non-empty parameter are not expanded, so this page does not transclude Template:X1 and is not in Category:X1.