{false}

The constant FALSE: its content is skipped and its @else@ part renders instead.

Conditions Either form

Syntax

{false}
{false} ... {/false}
{false} ... @else@ ... {/false}

Description

{false} answers FALSE, which is the level's "else" state: the content does not render, and the @else@ part of the pair renders in its place. Alone it prints nothing. It is the fixed "no" beside {true} and {null}.

The common use is switching a block of a template off without deleting it: change {true} to {false}, or wrap the block in {false} ... {/false} - unlike a comment, the content still has to be a valid template. It is also the simplest way to see what a tag's @else@ or else= option does, since nothing else influences the outcome.

The else='name' option, which every tag takes, puts a stored {content} in place of a level that answered FALSE, an empty list or an empty text. That is where {false} and {null} differ: a NULL fires null=, not else=.

Examples

Switched off

The content of {false} is skipped; the @else@ part renders.

Templateexamples/false/1-else.pad
{false}
  <p>The new banner - not yet.</p>
@else@
  <p>The old banner.</p>
{/false}
Resultopen alone

The old banner.

The else option

else= puts a stored content in place of a level that answered FALSE.

Templateexamples/false/2-option.pad
{content 'falseNote'}<p><em>Nothing to show here.</em></p>{/content}
{false else='falseNote'}
  <p>Hidden.</p>
{/false}
Resultopen alone

Nothing to show here.

See also

  • {true} The constant TRUE: its content renders once, as a level of its own.
  • {null} The constant NULL: its content is dropped, the @else@ part too, and a null= option fires.
  • {if} Renders its content only when a condition holds, with elseif and else branches.