Base Tag Library
Note: We have updated our folder structure in Neto 6 and this has not been updated on all tweaks yet. More info.

IF Statements

Neto's IF, IF THEN & ELSE function


[%if [@somedata@] like 'apple' %]
[%elseif [@somedata@] like 'orange' %]
[%elseif [@somedata@] ne '' %]


Simple Statements

Let's say we are working on a product template and want to display the message "Free shipping", but only on products where the price is greater than $200. Since the product will either have a price greater than $200 or less than $200, the “if” logic statement is the most appropriate statement to use:

[%if [@price@] > 200%]Free Shipping[%/if%]

Complex Statements

A complex logic statement contains two or more parameters. For example:

If you only wanted to display the "free shipping" text only when the price was greater than $200 and if the description was not empty you could use:

[%if [@price@] > 200 and [@description@] ne ''%]Free Shipping[%/if%]


== Equal to (for integers)
eq Equal to (for strings)
!= Not equal
< Less than
> More than
<= Less than or equal to
>= More than or equal to
or either this or that
and must be this and that

5 related articles found: