{% set uniqueAreas = [] %}
{% for slide in slide_data %}
{{ slide['#templateTitle'] }}
{% set startDate = slide['#scheduledDate'][0]['value'] %}
{% set endDate = slide['#scheduledDate'][0]['end_value'] %}
{{ startDate|date('d/m/Y') }} - {{ endDate|date('d/m/Y') }}
{{ slide['#duration'] }}
Seconds
{#
#}
{{ slide['#numberOfStoreLocationNodes'] }}
{{ 'Locations' }}
×
{{ 'Slide [' ~ slide['#templateTitle'] ~ '] Is currently active in:' }}
{% set uniqueAreas = {} %}
{% for address in slide['#addressInfo'] %}
{% set currentArea = address.administrativeArea %}
{% set currentLocality = address.locality %}
{% set areaLocality = currentArea ~ '-' ~ currentLocality %}
{% if uniqueAreas[currentArea] is not defined %}
{% set uniqueAreas = uniqueAreas|merge({ (currentArea): [] }) %}
{% endif %}
{% if areaLocality not in uniqueAreas[currentArea] %}
{% set uniqueAreas = uniqueAreas|merge({ (currentArea): uniqueAreas[currentArea]|merge([areaLocality]) }) %}
{% endif %}
{% endfor %}
{% set sortedAreas = uniqueAreas|keys|sort %}
{% for uniqueArea in sortedAreas %}
{% set localities = uniqueAreas[uniqueArea] %}
{{ uniqueArea }}
{% for areaLocality in localities %}
{% set currentAreaLocality = areaLocality|split('-') %}
{{ currentAreaLocality[1] }}
{% set currentStoreLocations = [] %}
{% for index, addressInfo in slide['#addressInfo'] %}
{% if addressInfo.administrativeArea == currentAreaLocality[0] and addressInfo.locality == currentAreaLocality[1] %}
{% set currentStoreLocations = currentStoreLocations|merge([slide['#storeLocationTitle'][index]]) %}
{% endif %}
{% endfor %}
{% for locationTitle in currentStoreLocations %}