From 7abf8b05dc91df4ec84f99aba639cd5d5b948047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hrvoje=20Kne=C5=BEevi=C4=87?= Date: Wed, 25 Sep 2024 12:25:18 +0200 Subject: [PATCH] Add default values to variables and check if set before including additional templates --- .../themes/ngadmin/content/tab/urls.html.twig | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bundle/Resources/views/themes/ngadmin/content/tab/urls.html.twig b/bundle/Resources/views/themes/ngadmin/content/tab/urls.html.twig index a8f9557..cc867f9 100644 --- a/bundle/Resources/views/themes/ngadmin/content/tab/urls.html.twig +++ b/bundle/Resources/views/themes/ngadmin/content/tab/urls.html.twig @@ -1,12 +1,16 @@ {% trans_default_domain 'ibexa_content_url' %} -{% include '@ibexadesign/content/tab/url/siteaccess_urls_table.html.twig' with { - headline:'tab.urls.siteaccess.headline.siteaccess_urls'|trans|desc - ('Siteaccess URLs'), - siteaccess_urls: siteaccess_urls, -} only %} +{% if siteaccess_urls|default([]) is not empty %} + {% include '@ibexadesign/content/tab/url/siteaccess_urls_table.html.twig' with { + headline:'tab.urls.siteaccess.headline.siteaccess_urls'|trans|desc + ('Siteaccess URLs'), + siteaccess_urls: siteaccess_urls, + } only %} +{% endif %} -{% if show_siteaccess_urls_outside_configured_content_tree_root %} +{% if show_siteaccess_urls_outside_configured_content_tree_root|default(false) == true + and siteaccess_urls_outside_configured_content_tree_root|default([]) is not empty +%} {% include '@ibexadesign/content/tab/url/siteaccess_urls_table.html.twig' with { headline: 'tab.urls.siteaccess.headline.siteaccess_urls.outside_configured_content_tree_root'|trans|desc