user9003762 user9003762 - 3 months ago 51
Smarty Question

How to include multiple values in IF statement (Smarty)

We have an IF statement within our smarty templates, which is as follows:

{if $category->id == 90}

We need to find out how to include multiple categories, so for e.g 95, 96 and 97.

Answer Source

you can just chain them like this:


{if $category-> == 90 || $category->id == 95 || $category-> == 96}


You can read more about this topic in the official docs:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download