Examples: Houston, US, TX | Munich, DE, Germany
This done this way:
1 .JCI-Template:
[jsoncontentimporterpro id=ID_OF_TEMPLATE httpstatuscodemustbe200=no]
2. twig-template:
- url:
http://api.zippopotam.us/{% if urlparam.co %}{{urlparam.co}}{% else %}US{% endif %}/{% if urlparam.zip %}{{urlparam.zip}}{% else %}80636{% endif %}
- urlparam4twig: zip#co
- twig-code (“/zippopotamus/” is the URL to the WordPress-Page with the Shortcode):
{% if urlparam.co %}{% set coun = urlparam.co %}{% else %}{% set coun = "US" %}{% endif %}
{% if places %} Found:
- {% for p in places %}
- {{ attribute(p, 'place name') }} ({{ attribute(p, 'state abbreviation') }}) {% endfor %}
Examples: Houston, US, TX | Munich, DE, Germany