I have a simple for loop
to get the names of countries from a category.
{% for name in country %} {{ name.title }} {% endfor %}
The output is typically returns the name of 1 country. But, some entries are associated with more than one country.
For example:
Belgium Czech Republic Denmark Greece Netherlands Norway Portugal
How do I template for an entry that returns 2-N country names by adding ","
between each country and "and"
before the last country?
This is what I want to output:
Belgium, Czech Republic, Denmark, Greece, Netherlands, Norway and Portugal