geo-coop/web/themes/custom/geofresco/src/templates/layout/ds-1col--node-card.html.twig
benjamin melançon 3777ffe098 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?
2019-10-01 13:12:21 -04:00

29 lines
757 B
Twig

{#
/**
* @file
* Display Suite 1 column template.
*
* Available variables:
* - ds_content_wrapper: wrapper around content
* - attributes: content region attributes
* - ds_content: content region
*/
#}
<{{ ds_content_wrapper }}{{ attributes.addClass('ds-1col', 'card', 'clearfix') }}>
{{ 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 %}
<a href="/test" class="background-replacement-for-no-image image"></a>
{% endif %}
{{ ds_content|without('field_image') }}
</{{ ds_content_wrapper }}>