TPLix

No results for ""

Else

2 min read Jun 3, 2026
--- title: else autoseo: enabled: true theme: learn2 child_type: default admin: children_display_order: collection visible: true ---

else — Generic else block, it supports all builtin optional-display blocks which are if,elseif, loop, for, foreach and with.

If any of those block contains an else statement, the content between {else} and {/*blockname*} (you do not need to close the else block) will be shown if the block’s condition has no been met

Examples:

Where template is:


{foreach $array val}
    $array is not empty so we display it's values : {$val}
{else}
    if this shows, it means that $array is empty or doesn't exist.
{/foreach}
	

Leave a Comment

Not published. Used to notify you on approval.

Comments are moderated before appearing.