Search code examples
dust.jsdust-helpersdustc

Dustjs OR helper


How to write below statement using dust helper?

{@eq key="device" value="windows || Linux"}
     Your system is Windows or Linux based.
{:else}
     Your system is MAC based.
{/eq}

Solution

  • You can use the @any helper with the Select Helper to achieve this:

    {@select key=device}
      {@eq value="windows"/}
      {@eq value="Linux"/}
      {@any}Your system is Windows or Linux based.{/any}
      {@none}Your system is MAC based.{/none}
    {/select}