From 3777ffe0980194a846a2fe9158df7e2f00ef3d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 1 Oct 2019 13:12:21 -0400 Subject: [PATCH] There is no bloody way to get a node URL from a DS template ... not without the internet, at least. Why the hell can't you build associative arrays in Twig? Should have just done a preprocess function, but seriously, what in the hell? --- .../src/templates/layout/ds-1col--node-card.html.twig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/themes/custom/geofresco/src/templates/layout/ds-1col--node-card.html.twig b/web/themes/custom/geofresco/src/templates/layout/ds-1col--node-card.html.twig index 70e3eda..07e4c45 100644 --- a/web/themes/custom/geofresco/src/templates/layout/ds-1col--node-card.html.twig +++ b/web/themes/custom/geofresco/src/templates/layout/ds-1col--node-card.html.twig @@ -13,11 +13,16 @@ {{ title_suffix.contextual_links }} + {% set route_options = [] %} + {% set route_options['node'] = node %} + {% set link_path = path('entity.node.canonical', route_options) %} + {{ url }} + {{ node.id }} {% set image = ds_content.field_image|render %} {% if image %} {{ image }} {% else %} -
+ {% endif %} {{ ds_content|without('field_image') }}