From 3ef8d48ee29abecd1fea7228094f6a8b681f2581 Mon Sep 17 00:00:00 2001 From: Mischa Date: Fri, 19 Jun 2026 22:18:04 +0200 Subject: [PATCH] feat: add entry url to map_entries data and as data-url attribute on all markers --- themes/intotheeast/templates/dailies.html.twig | 1 + themes/intotheeast/templates/home.html.twig | 4 +++- themes/intotheeast/templates/map.html.twig | 1 + themes/intotheeast/templates/trip.html.twig | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/themes/intotheeast/templates/dailies.html.twig b/themes/intotheeast/templates/dailies.html.twig index 5eeccd2..68d415d 100644 --- a/themes/intotheeast/templates/dailies.html.twig +++ b/themes/intotheeast/templates/dailies.html.twig @@ -58,6 +58,7 @@ feedMap.on('load', function () { bounds.extend(lngLat); var el = MapUtils.createDotMarker(isLatest); + el.dataset.url = entry.url; var popup = new maplibregl.Popup({ offset: 12, closeButton: false, closeOnClick: false, className: 'map-tip-popup' }) .setLngLat(lngLat) .setHTML('' + entry.title + ''); diff --git a/themes/intotheeast/templates/home.html.twig b/themes/intotheeast/templates/home.html.twig index 281ff61..a4fe04c 100644 --- a/themes/intotheeast/templates/home.html.twig +++ b/themes/intotheeast/templates/home.html.twig @@ -27,7 +27,8 @@ 'lat': item.page.header.lat|number_format(6, '.', ''), 'lng': item.page.header.lng|number_format(6, '.', ''), 'slug': item.page.slug, - 'title': item.page.title + 'title': item.page.title, + 'url': item.page.url }]) %} {% endif %} {% endfor %} @@ -147,6 +148,7 @@ homeMap.on('load', function () { bounds.extend(lngLat); var el = MapUtils.createDotMarker(isLatest); + el.dataset.url = entry.url; var popup = new maplibregl.Popup({ offset: 12, closeButton: false, closeOnClick: false, className: 'map-tip-popup' }) .setLngLat(lngLat) .setHTML('' + entry.title + ''); diff --git a/themes/intotheeast/templates/map.html.twig b/themes/intotheeast/templates/map.html.twig index 889bb5e..ed9e6c2 100644 --- a/themes/intotheeast/templates/map.html.twig +++ b/themes/intotheeast/templates/map.html.twig @@ -91,6 +91,7 @@ map.on('load', function () { bounds.extend(lngLat); var el = MapUtils.createDotMarker(isLatest); + el.dataset.url = entry.url; var popup = new maplibregl.Popup({ offset: 12, closeButton: false, closeOnClick: false, className: 'map-tip-popup' }) .setLngLat(lngLat) .setHTML('' + entry.title + ''); diff --git a/themes/intotheeast/templates/trip.html.twig b/themes/intotheeast/templates/trip.html.twig index 087be2e..8c66e21 100644 --- a/themes/intotheeast/templates/trip.html.twig +++ b/themes/intotheeast/templates/trip.html.twig @@ -67,7 +67,8 @@ 'lat': item.page.header.lat|number_format(6, '.', ''), 'lng': item.page.header.lng|number_format(6, '.', ''), 'slug': item.page.slug, - 'title': item.page.title + 'title': item.page.title, + 'url': item.page.url }]) %} {% endif %} {% endfor %} @@ -250,6 +251,7 @@ tripMap.on('load', function () { bounds.extend(lngLat); var el = MapUtils.createDotMarker(isLatest); + el.dataset.url = entry.url; var popup = new maplibregl.Popup({ offset: 12, closeButton: false, closeOnClick: false, className: 'map-tip-popup' }) .setLngLat(lngLat) .setHTML('' + entry.title + '');