Conditional Content

Show postal ranges.

3 months 3 weeks ago #75963

Robert Clinton's Avatar Robert Clinton

I would like to have a page that shows a range of locations based on US postal code location radius's.

The HTML code would be as follows:

{show postalcode="02860"}
location found
{show-else}
no location
{/show}
<br />
{show postalcode="02870"}
location found
{show-else}
no location
{/show}
Since I am creating multiple zones on the same page, is there any kind of elseif statement that can be applied here to avoid multiple "no location" displays like below?
{show postalcode="02860"}
location found
{show-elseif postalcode="02870"}
another location found
{show-else}
no location
{/show}

3 months 3 weeks ago #75968

Peter van Westen's Avatar Peter van Westen Admin

No, you can not use ifelse structures.
You would have to do something like:

{show postalcode="02860"}
location found
{/show}

{show postalcode="02870"}
another location found
{/show}

{hide postalcode="02860,02870"}
no location
{/hide}

3 months 3 weeks ago #75972

Robert Clinton's Avatar Robert Clinton

:) That totally works.

Thanks Peter!

3 months 3 weeks ago #75974

Peter van Westen's Avatar Peter van Westen Admin

My pleasure :)