XModPro

Using xmod if statement

Harry Allan Harry Allan posted May 19, 2015
Active May 19 · Viewed 2295 times

So I'm creating a dropdown list from a database that's all working fine but I want to only display certain items inside this dropdown.

I thought using the xmod;if statement would work but the documentation is pretty useless for me.

Can i use the if statement like this ( I replaced the chevrons with | to avoid code stripping hopefully):

|xmod:Template id="city" UsePaging="False" Ajax="False"|

|ListDataSource CommandText="SELECT countryID, cityName FROM city" ConnectionString='[[ConnectionString:Excursions]]'|

|/ListDataSource|

|HeaderTemplate|

|label|City: |/label|

|xmod:if name ="ddl-city" value="6"|

|select id="city"|

|/HeaderTemplate|

|ItemTemplate|

|option name="ddl-city" value="[[countryID]]"|[[cityName]]|/option|

|/ItemTemplate|

|FooterTemplate|

|/select|

|/xmod:if|

|/FooterTemplate|

|/xmod:Template|

3 Replies

Loading replies...