Skip to content

Commit 0573cd9

Browse files
author
Simon L. Lange
committed
VLZ-673-37732: Conditional logic if URL field is set
1 parent 84b4fa2 commit 0573cd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/themes/custom/subsites/fds_ringsted_theme/templates/node/teaser/node--os2web-event--teaser.html.twig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
] %}
8181
{{ attach_library('classy/node') }}
8282
<article{{ attributes.addClass(classes) }}>
83-
<a class="fullhref" target="_blank" href="{{ url('entity.node.canonical', {'node': node.id}) }}" rel="bookmark">{{ label }}</a>
83+
{% set link_event_url = node.field_os2web_event_url.value ? node.field_os2web_event_url.value : url('entity.node.canonical', {'node': node.id}) %}
84+
<a class="fullhref" target="_blank" href="{{ link_event_url }}" rel="bookmark">{{ label }}</a>
8485

8586
{{ title_prefix }}
8687
{% if label and not page %}

0 commit comments

Comments
 (0)