Conditional Content

Conditional content per country

11 months 1 week ago #76555

Rick Spaan's Avatar Rick Spaan

First of all, great piece of software!
I would like to show a text based on the geolocation of the website visitor, but when the country isn't "listed", then they should see a general text in English. I know the syntax below isn't right, but I would like to do something like this:

{show countries="Netherlands"}
Bekijk de dichtsbijzijnde winkel

{show countries="Germany"}
Finden Sie einen Fachhändler in Ihrer Nähe

{show countries="Romania"}
Găsește cel mai apropiat magazin

{show-else}
Find the nearest store
{/show}

How can I achieve that with the correct code? Thanks!

11 months 1 week ago #76556

Peter van Westen's Avatar Peter van Westen Admin

You cannot use multiple elses with Conditional Content. But this will work:

{show countries="Netherlands"}
Bekijk de dichtsbijzijnde winkel
{/show}{show countries="Germany"}
Finden Sie einen Fachhändler in Ihrer Nähe
{/show}{show countries="Romania"}
Găsește cel mai apropiat magazin
{/show}{show countries!="Netherlands,Germany,Romania"}
Find the nearest store
{/show}

For the last tag (for all other countries) you can choose to do:
{show countries!="Netherlands,Germany,Romania"}
Find the nearest store
{/show}
Or:
{hide countries="Netherlands,Germany,Romania"}
Find the nearest store
{/hide}
Both will do the same. Use whatever is most readable/understandable for you.

11 months 1 week ago #76565

Rick Spaan's Avatar Rick Spaan

Works like a charm. Thanks!

11 months 1 week ago #76569

Peter van Westen's Avatar Peter van Westen Admin

Great :)