lundi 20 juin 2016

TPL Multiple IF statements

I am working on a TPL statement where I need to check if "phoneNumber1== null or phoneNumber1== ''" If it is either of those it goes to the next line and checks. Here is what I have so far...

   <tpl if="phoneNumber1 != null && phoneNumber1 != ''">{phoneNumber1}</tpl>
   <tpl if="phoneNumber2 != null && (phoneNumber1 == '' || phoneNumber1 == null) && phoneNumber2 != ''">{phoneNumber2}</tpl>
   <tpl if="phoneNumber3 != null && phoneNumber2 == '' && phoneNumber1 == ''">{LEASLINE}/tpl>  

What would be the correct way to write this to check each phoneNumber for null and equal to '', but also only print the first one that returns data. Ex if phoneNumber1 is not null then print phoneNumber1 and not print phoneNumber2 and phoneNumber3.

Any solutions are appreciated! :)

Aucun commentaire:

Enregistrer un commentaire