@ Modifiers

@IF / @ELSEIF / @ELSE / @ENDIF

Useful for creating pages which have complicated structures, such as the administration interface. Previously, if such a branching process was required, it was necessary to create a multitude of chunks to accomplish the same.

Determine the presence or absence of a value, as such, the combination with a modifier is highly effective.

There are various methods to accomplish the same request:

<@IF:[*template:is(0)*]>
    Template is blank
<@ELSE>
    Template is [*template:templatename*]
    <@IF:[*description:isNotEmpty*]>
        [*description*]
    <@ENDIF>
<@ENDIF>

or

<!--@IF:[*template:is(0)*]-->
    Template is blank
<!--@ELSE-->
    Template is [*template:templatename*]
    <!--@IF:[*description:isNotEmpty*]-->
        [*description*]
    <!--@ENDIF-->
<!--@ENDIF-->

or

<!--@IF:[*template:is(0)*]>
    Template is blank
<@ELSE>
    Template is [*template:templatename*]
    <@IF:[*description:isNotEmpty*]>
        [*description*]
    <@ENDIF>
<@ENDIF-->

 

Modifiers can be used in a variety of ways and for a variety of functions.

Used as a Global Function.

<@IF:[!$_SERVER['REQUEST_TIME']:dateFormat(H):lt(12)!]>
    Morning
<@ELSEIF:[!$_SERVER['REQUEST_TIME']:dateFormat(H):lt(16)!]>
    Day time
<@ELSEIF:[!$_SERVER['REQUEST_TIME']:dateFormat(H):lt(19)!]>
    Evening
<@ELSE>
    Night
<@ENDIF>

Even more situations where they can be used.

<@IF:[*id:is('[(site_start)]')*]>
This Is The Top Of The List
<@ENDIF>

Suggest an edit to this page.