diff --git a/core/includes/common.inc b/core/includes/common.inc index 2def62d..d11a3f8 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3992,7 +3992,20 @@ function render(&$element) { } if (is_array($element)) { show($element); - return drupal_render($element, TRUE); + + // Try to get the rendered element from the static cache. This only + // persists for the current request, and is needed because we test if a + // render array produces output by rendering it and checking if the output + // is empty. So without this, if the element is not cached by drupal_render, + // it is rendered for each test, and also for printing on page. + $static_cache = &drupal_static(__FUNCTION__); + $static_cid = md5(serialize($element)); + + if (!isset($static_cache[$static_cid])) { + $static_cache[$static_cid] = drupal_render($element, TRUE); + } + + return $static_cache[$static_cid]; } else { // Safe-guard for inappropriate use of render() on flat variables: return @@ -4057,6 +4070,20 @@ function show(&$element) { } /** + * Tests if a render array produces output in the current context. + * + * @param array $element + * The render array to test. + * + * @return boolean + * Whether the render array produced content or not. + */ +function is_printable($element) { + $rendered = render($element); + return !empty($rendered); +} + +/** * Gets the cached, prerendered element of a renderable element from the cache. * * @param array $elements diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 4cb31ca..d16745a 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -56,6 +56,15 @@ public function getFilters() { /** * {@inheritdoc} */ + public function getTests() { + return array( + new \Twig_SimpleTest('printable', 'is_printable'), + ); + } + + /** + * {@inheritdoc} + */ public function getNodeVisitors() { // The node visitor is needed to wrap all variables with // render_var -> twig_render_var() function. diff --git a/core/modules/aggregator/templates/aggregator-item.html.twig b/core/modules/aggregator/templates/aggregator-item.html.twig index 8c23106..76ec14c 100644 --- a/core/modules/aggregator/templates/aggregator-item.html.twig +++ b/core/modules/aggregator/templates/aggregator-item.html.twig @@ -28,7 +28,7 @@ {{ source_date }} - {% if content %} + {% if content is printable %}
{{ content }}
diff --git a/core/modules/block/templates/block.html.twig b/core/modules/block/templates/block.html.twig index 3c51d46..711ddf5 100644 --- a/core/modules/block/templates/block.html.twig +++ b/core/modules/block/templates/block.html.twig @@ -43,7 +43,7 @@ #} {{ title_prefix }} - {% if label %} + {% if label is printable %} {{ label }} {% endif %} {{ title_suffix }} diff --git a/core/modules/comment/templates/comment-wrapper.html.twig b/core/modules/comment/templates/comment-wrapper.html.twig index b19c051..6f52da7 100644 --- a/core/modules/comment/templates/comment-wrapper.html.twig +++ b/core/modules/comment/templates/comment-wrapper.html.twig @@ -36,7 +36,7 @@ */ #} - {% if comments and (entity.entityType != 'node' or entity.bundle != 'forum') %} + {% if comments is printable and (entity.entityType != 'node' or entity.bundle != 'forum') %} {{ title_prefix }}

{{ 'Comments'|t }}

{{ title_suffix }} @@ -44,7 +44,7 @@ {{ comments }} - {% if form %} + {% if form is printable %}

{{ 'Add new comment'|t }}

{{ form }} {% endif %} diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig index 5fca73b..a76cfb9 100644 --- a/core/modules/comment/templates/comment.html.twig +++ b/core/modules/comment/templates/comment.html.twig @@ -87,7 +87,7 @@ for accessibility. The list is difficult to navigate in a screen reader without this information. #} - {% if parent %} + {% if parent is printable %}

{{ parent }}

{% endif %} @@ -97,7 +97,7 @@ {{ content|without('links') }} - {% if signature %} + {% if signature is printable %}
{{ signature }}
diff --git a/core/modules/datetime/templates/datetime-wrapper.html.twig b/core/modules/datetime/templates/datetime-wrapper.html.twig index a4acf70..9263829 100644 --- a/core/modules/datetime/templates/datetime-wrapper.html.twig +++ b/core/modules/datetime/templates/datetime-wrapper.html.twig @@ -15,12 +15,12 @@ * @ingroup themeable */ #} -{% if title %} +{% if title is printable %}

{% trans %}{{ title|passthrough }}{{ required|passthrough }}{% endtrans %}

{% endif %} {{ content }} -{% if description %} +{% if description is printable %}
{{ description }}
{% endif %} diff --git a/core/modules/filter/templates/text-format-wrapper.html.twig b/core/modules/filter/templates/text-format-wrapper.html.twig index f453971..f201187 100644 --- a/core/modules/filter/templates/text-format-wrapper.html.twig +++ b/core/modules/filter/templates/text-format-wrapper.html.twig @@ -12,7 +12,7 @@ #}
{{ children }} - {% if description %} + {% if description is printable %}
{{ description }}
{% endif %}
diff --git a/core/modules/forum/templates/forum-list.html.twig b/core/modules/forum/templates/forum-list.html.twig index 5b41f6a..f8e4442 100644 --- a/core/modules/forum/templates/forum-list.html.twig +++ b/core/modules/forum/templates/forum-list.html.twig @@ -59,7 +59,7 @@ {{ forum.icon_title }} - {% if forum.description.value %} + {% if forum.description.value is printable %}
{{ forum.description.value }}
{% endif %} {% for i in 1..forum.depth if forum.depth > 0 %}{% endfor %} diff --git a/core/modules/forum/templates/forum-submitted.html.twig b/core/modules/forum/templates/forum-submitted.html.twig index f679363..31e148e 100644 --- a/core/modules/forum/templates/forum-submitted.html.twig +++ b/core/modules/forum/templates/forum-submitted.html.twig @@ -16,7 +16,7 @@ * @ingroup themeable */ #} -{% if time %} +{% if time is printable %} {% else %} {{ 'n/a'|t }} diff --git a/core/modules/link/templates/link-formatter-link-separate.html.twig b/core/modules/link/templates/link-formatter-link-separate.html.twig index 16b91ed..0054f1b 100644 --- a/core/modules/link/templates/link-formatter-link-separate.html.twig +++ b/core/modules/link/templates/link-formatter-link-separate.html.twig @@ -16,7 +16,7 @@ #} {% spaceless %} diff --git a/core/modules/search/templates/search-result.html.twig b/core/modules/search/templates/search-result.html.twig index 732489b..65f8648 100644 --- a/core/modules/search/templates/search-result.html.twig +++ b/core/modules/search/templates/search-result.html.twig @@ -64,10 +64,10 @@ {{ title_suffix }}
- {% if snippet %} + {% if snippet is printable %}

{{ snippet }}

{% endif %} - {% if info %} + {% if info is printable %}

{{ info }}

{% endif %}
diff --git a/core/modules/system/templates/admin-block-content.html.twig b/core/modules/system/templates/admin-block-content.html.twig index a49bf10..6efbd36 100644 --- a/core/modules/system/templates/admin-block-content.html.twig +++ b/core/modules/system/templates/admin-block-content.html.twig @@ -19,7 +19,7 @@ {% for item in content %}
{{ item.link }}
- {% if item.description %} + {% if item.description is printable %}
{{ item.description }}
{% endif %} {% endfor %} diff --git a/core/modules/system/templates/admin-block.html.twig b/core/modules/system/templates/admin-block.html.twig index 20aa000..e16592e 100644 --- a/core/modules/system/templates/admin-block.html.twig +++ b/core/modules/system/templates/admin-block.html.twig @@ -15,12 +15,12 @@ */ #}
- {% if block.title %} + {% if block.title is printable %}

{{ block.title }}

{% endif %} - {% if block.content %} + {% if block.content is printable %}
{{ block.content }}
- {% elseif block.description %} + {% elseif block.description is printable %}
{{ block.description }}
{% endif %}
diff --git a/core/modules/system/templates/block--system-branding-block.html.twig b/core/modules/system/templates/block--system-branding-block.html.twig index 2a12c7a..b623596 100644 --- a/core/modules/system/templates/block--system-branding-block.html.twig +++ b/core/modules/system/templates/block--system-branding-block.html.twig @@ -21,12 +21,12 @@ {{ 'Home'|t }} {% endif %} - {% if site_name %} + {% if site_name is printable %} {% endif %} - {% if site_slogan %} + {% if site_slogan is printable %}
{{ site_slogan }}
{% endif %} {% endblock %} diff --git a/core/modules/system/templates/details.html.twig b/core/modules/system/templates/details.html.twig index 17ea820..7fa9704 100644 --- a/core/modules/system/templates/details.html.twig +++ b/core/modules/system/templates/details.html.twig @@ -16,17 +16,17 @@ */ #} - {%- if title -%} + {%- if title is printable -%} {{ title }} {%- endif -%}
- {%- if description -%} + {%- if description is printable -%}
{{ description }}
{%- endif -%} - {%- if children -%} + {%- if children is printable -%} {{ children }} {%- endif -%} - {%- if value -%} + {%- if value is printable -%} {{ value }} {%- endif -%}
diff --git a/core/modules/system/templates/dropbutton-wrapper.html.twig b/core/modules/system/templates/dropbutton-wrapper.html.twig index ca0ff7e..c773d15 100644 --- a/core/modules/system/templates/dropbutton-wrapper.html.twig +++ b/core/modules/system/templates/dropbutton-wrapper.html.twig @@ -12,7 +12,7 @@ * @ingroup themeable */ #} -{% if children %} +{% if children is printable %} {% spaceless %}
diff --git a/core/modules/system/templates/fieldset.html.twig b/core/modules/system/templates/fieldset.html.twig index 9e4fe68..1552c28 100644 --- a/core/modules/system/templates/fieldset.html.twig +++ b/core/modules/system/templates/fieldset.html.twig @@ -28,14 +28,14 @@ {{ legend.title }}{{ required }} {%- endif %}
- {% if prefix %} + {% if prefix is printable %} {{ prefix }} {% endif %} {{ children }} - {% if suffix %} + {% if suffix is printable %} {{ suffix }} {% endif %} - {% if description.content %} + {% if description.content is printable %} {{ description.content }}
{% endif %}
diff --git a/core/modules/system/templates/form-element.html.twig b/core/modules/system/templates/form-element.html.twig index ea4d90f..9078b49 100644 --- a/core/modules/system/templates/form-element.html.twig +++ b/core/modules/system/templates/form-element.html.twig @@ -50,7 +50,7 @@ {% if label_display == 'after' %} {{ label }} {% endif %} - {% if description.content %} + {% if description.content is printable %} {{ description.content }}
diff --git a/core/modules/system/templates/install-page.html.twig b/core/modules/system/templates/install-page.html.twig index 031013e..78e8448 100644 --- a/core/modules/system/templates/install-page.html.twig +++ b/core/modules/system/templates/install-page.html.twig @@ -24,12 +24,12 @@
- {% if site_name or site_slogan %} + {% if site_name is printable or site_slogan is printable %}
- {% if site_name %} + {% if site_name is printable %}

{{ site_name }}

{% endif %} - {% if site_slogan %} + {% if site_slogan is printable %}
{{ site_slogan }}
{% endif %}
{# /.name-and-slogan #} @@ -37,26 +37,26 @@
- {% if title %} + {% if title is printable %}

{{ title }}

{% endif %} {{ messages }} {{ content }}
- {% if sidebar_first %} + {% if sidebar_first is printable %} {# /.l-sidebar-first #} {% endif %} - {% if sidebar_second %} + {% if sidebar_second is printable %} {# /.l-sidebar-second #} {% endif %} - {% if footer %} + {% if footer is printable %}
{{ footer }}
diff --git a/core/modules/system/templates/item-list.html.twig b/core/modules/system/templates/item-list.html.twig index e8d16e0..936d348 100644 --- a/core/modules/system/templates/item-list.html.twig +++ b/core/modules/system/templates/item-list.html.twig @@ -18,12 +18,12 @@ * @ingroup themeable */ #} -{%- if items or empty -%} +{%- if items is printable or empty is printable -%}
- {%- if title -%} + {%- if title is printable -%}

{{ title }}

{%- endif -%} - {%- if items -%} + {%- if items is printable -%} <{{ list_type }}{{ attributes }}> {%- for item in items -%} {{ item.value }} diff --git a/core/modules/system/templates/links.html.twig b/core/modules/system/templates/links.html.twig index 65d87c2..f3de7f1 100644 --- a/core/modules/system/templates/links.html.twig +++ b/core/modules/system/templates/links.html.twig @@ -46,7 +46,7 @@ {%- for item in links -%} - {%- if item.link -%} + {%- if item.link is printable -%} {{ item.link }} {%- elseif item.text_attributes -%} {{ item.text }} diff --git a/core/modules/system/templates/maintenance-page.html.twig b/core/modules/system/templates/maintenance-page.html.twig index b5275c7..9d9978b 100644 --- a/core/modules/system/templates/maintenance-page.html.twig +++ b/core/modules/system/templates/maintenance-page.html.twig @@ -30,15 +30,15 @@ {% endif %} - {% if site_name or site_slogan %} + {% if site_name is printable or site_slogan is printable %}
- {% if site_name %} + {% if site_name is printable %}

{{ site_name }}

{% endif %} - {% if site_slogan %} + {% if site_slogan is printable %}
{{ site_slogan }}
{% endif %}
{# /.name-and-slogan #} @@ -47,7 +47,7 @@
- {% if title %} + {% if title is printable %}

{{ title }}

{% endif %} @@ -56,19 +56,19 @@ {{ content }}
- {% if page.sidebar_first %} + {% if page.sidebar_first is printable %} {# /.l-sidebar-first #} {% endif %} - {% if page.sidebar_second %} + {% if page.sidebar_second is printable %} {# /.l-sidebar-second #} {% endif %} - {% if page.footer %} + {% if page.footer is printable %}
{{ page.footer }}
diff --git a/core/modules/system/templates/page.html.twig b/core/modules/system/templates/page.html.twig index 1f6f916..31745cd 100644 --- a/core/modules/system/templates/page.html.twig +++ b/core/modules/system/templates/page.html.twig @@ -72,11 +72,11 @@ {% endif %} - {% if site_name or site_slogan %} + {% if site_name is printable or site_slogan is printable %}
{# Use h1 when the content title is empty #} - {% if title %} + {% if title is printable %} {{ site_name }} @@ -86,7 +86,7 @@ {% endif %} - {% if site_slogan %} + {% if site_slogan is printable %}
{{ site_slogan }}
{% endif %}
{# ./name-and-slogan #} @@ -95,7 +95,7 @@ {{ page.header }} - {% if main_menu or secondary_menu %} + {% if main_menu is printable or secondary_menu is printable %}
{# /.l-content #} - {% if page.sidebar_first %} + {% if page.sidebar_first is printable %} {% endif %} - {% if page.sidebar_second %} + {% if page.sidebar_second is printable %} @@ -145,7 +145,7 @@ - {% if page.footer %} + {% if page.footer is printable %}
{{ page.footer }}
diff --git a/core/modules/system/templates/pager.html.twig b/core/modules/system/templates/pager.html.twig index 47b20a7..b13cdb4 100644 --- a/core/modules/system/templates/pager.html.twig +++ b/core/modules/system/templates/pager.html.twig @@ -11,7 +11,7 @@ * @ingroup themeable */ #} -{% if items %} +{% if items is printable %}

{{ 'Pages'|t }}

{{ items }} {% endif %} diff --git a/core/modules/system/templates/progress-bar.html.twig b/core/modules/system/templates/progress-bar.html.twig index 885a80f..190c51e 100644 --- a/core/modules/system/templates/progress-bar.html.twig +++ b/core/modules/system/templates/progress-bar.html.twig @@ -14,7 +14,7 @@ */ #}
- {% if label %} + {% if label is printable %}
{{ label }}
{% endif %}
diff --git a/core/modules/system/templates/region.html.twig b/core/modules/system/templates/region.html.twig index 9213e02..d7f96c3 100644 --- a/core/modules/system/templates/region.html.twig +++ b/core/modules/system/templates/region.html.twig @@ -20,7 +20,7 @@ * @ingroup themeable */ #} -{% if content %} +{% if content is printable %} {{ content }}
diff --git a/core/modules/system/templates/status-messages.html.twig b/core/modules/system/templates/status-messages.html.twig index 505eb20..e75acde 100644 --- a/core/modules/system/templates/status-messages.html.twig +++ b/core/modules/system/templates/status-messages.html.twig @@ -28,7 +28,7 @@ {% if type == 'error' %}
{% endif %} - {% if status_headings[type] %} + {% if status_headings[type] is printable %}

{{ status_headings[type] }}

{% endif %} {% if messages|length > 1 %} diff --git a/core/modules/system/templates/status-report.html.twig b/core/modules/system/templates/status-report.html.twig index d01f163..1c66a95 100644 --- a/core/modules/system/templates/status-report.html.twig +++ b/core/modules/system/templates/status-report.html.twig @@ -33,7 +33,7 @@ {{ requirement.title }} {{ requirement.value }} - {% if requirement.description %} + {% if requirement.description is printable %}
{{ requirement.description }}
{% endif %} diff --git a/core/modules/system/templates/system-themes-page.html.twig b/core/modules/system/templates/system-themes-page.html.twig index 80089fd..da451fb 100644 --- a/core/modules/system/templates/system-themes-page.html.twig +++ b/core/modules/system/templates/system-themes-page.html.twig @@ -32,7 +32,7 @@

{{ theme_group.title }}

{% for theme in theme_group.themes %} - {% if theme.screenshot %} + {% if theme.screenshot is printable %} {{ theme.screenshot }} {% else %}
diff --git a/core/modules/toolbar/templates/toolbar.html.twig b/core/modules/toolbar/templates/toolbar.html.twig index bcd3364..855ab63 100644 --- a/core/modules/toolbar/templates/toolbar.html.twig +++ b/core/modules/toolbar/templates/toolbar.html.twig @@ -33,7 +33,7 @@ {% spaceless %}
- {% if tray.label %} + {% if tray.label is printable %}

{{ tray.label }}

{% endif %} {{ tray.links }} diff --git a/core/modules/user/templates/user.html.twig b/core/modules/user/templates/user.html.twig index 2f6f640..81a5410 100644 --- a/core/modules/user/templates/user.html.twig +++ b/core/modules/user/templates/user.html.twig @@ -24,7 +24,7 @@ */ #} - {% if content %} + {% if content is printable %} {{- content -}} {% endif %} diff --git a/core/modules/views/templates/views-mini-pager.html.twig b/core/modules/views/templates/views-mini-pager.html.twig index 5fd95dc..1eb19ac 100644 --- a/core/modules/views/templates/views-mini-pager.html.twig +++ b/core/modules/views/templates/views-mini-pager.html.twig @@ -11,7 +11,7 @@ * @ingroup themeable */ #} -{% if items %} +{% if items is printable %}

{{ 'Pages'|t }}

{{ items }} {% endif %} diff --git a/core/modules/views/templates/views-view-grid.html.twig b/core/modules/views/templates/views-view-grid.html.twig index a5a813c..6ee2c5a 100644 --- a/core/modules/views/templates/views-view-grid.html.twig +++ b/core/modules/views/templates/views-view-grid.html.twig @@ -22,7 +22,7 @@ * @ingroup themeable */ #} -{% if title %} +{% if title is printable %}

{{ title }}

{% endif %} diff --git a/core/modules/views/templates/views-view-list.html.twig b/core/modules/views/templates/views-view-list.html.twig index 8de787c..8d8ce0b 100644 --- a/core/modules/views/templates/views-view-list.html.twig +++ b/core/modules/views/templates/views-view-list.html.twig @@ -21,7 +21,7 @@ {% if attributes -%} {% endif %} - {% if title %} + {% if title is printable %}

{{ title }}

{% endif %} diff --git a/core/modules/views/templates/views-view-summary-unformatted.html.twig b/core/modules/views/templates/views-view-summary-unformatted.html.twig index 9120dd4..3404a1b 100644 --- a/core/modules/views/templates/views-view-summary-unformatted.html.twig +++ b/core/modules/views/templates/views-view-summary-unformatted.html.twig @@ -21,7 +21,7 @@ #} {% for row in rows %} {{ options.inline ? ' - {% if row.separator -%} + {% if row.separator is printable -%} {{ row.separator }} {%- endif %} {{ row.link }} diff --git a/core/modules/views/templates/views-view-table.html.twig b/core/modules/views/templates/views-view-table.html.twig index 6b0b26c..180c7c9 100644 --- a/core/modules/views/templates/views-view-table.html.twig +++ b/core/modules/views/templates/views-view-table.html.twig @@ -29,7 +29,7 @@ {% if caption_needed %} - {% if caption %} + {% if caption is printable %} {{ caption }} {% else %} {{ title }} diff --git a/core/modules/views/templates/views-view-unformatted.html.twig b/core/modules/views/templates/views-view-unformatted.html.twig index e3fb2e3..00fadf8 100644 --- a/core/modules/views/templates/views-view-unformatted.html.twig +++ b/core/modules/views/templates/views-view-unformatted.html.twig @@ -14,7 +14,7 @@ * @ingroup themeable */ #} -{% if title %} +{% if title is printable %}

{{ title }}

{% endif %} {% for row in rows %} diff --git a/core/modules/views/templates/views-view.html.twig b/core/modules/views/templates/views-view.html.twig index f839ef9..154564f 100644 --- a/core/modules/views/templates/views-view.html.twig +++ b/core/modules/views/templates/views-view.html.twig @@ -39,53 +39,53 @@ #} {{ title_prefix }} - {% if title %} + {% if title is printable %} {{ title }} {% endif %} {{ title_suffix }} - {% if header %} + {% if header is printable %}
{{ header }}
{% endif %} - {% if exposed %} + {% if exposed is printable %}
{{ exposed }}
{% endif %} - {% if attachment_before %} + {% if attachment_before is printable %}
{{ attachment_before }}
{% endif %} - {% if rows %} + {% if rows is printable %}
{{ rows }}
- {% elseif empty %} + {% elseif empty is printable %}
{{ empty }}
{% endif %} - {% if pager %} + {% if pager is printable %} {{ pager }} {% endif %} - {% if attachment_after %} + {% if attachment_after is printable %}
{{ attachment_after }}
{% endif %} - {% if more %} + {% if more is printable %} {{ more }} {% endif %} - {% if footer %} + {% if footer is printable %} {% endif %} - {% if feed_icon %} + {% if feed_icon is printable %}
{{ feed_icon }}
diff --git a/core/modules/views/tests/modules/views_test_data/templates/views-view--frontpage.html.twig b/core/modules/views/tests/modules/views_test_data/templates/views-view--frontpage.html.twig index 0ccf2da..7387c7d 100644 --- a/core/modules/views/tests/modules/views_test_data/templates/views-view--frontpage.html.twig +++ b/core/modules/views/tests/modules/views_test_data/templates/views-view--frontpage.html.twig @@ -38,49 +38,49 @@ */ #} - {% if header %} + {% if header is printable %}
{{ header }}
{% endif %} - {% if exposed %} + {% if exposed is printable %}
{{ exposed }}
{% endif %} - {% if attachment_before %} + {% if attachment_before is printable %}
{{ attachment_before }}
{% endif %} - {% if rows %} + {% if rows is printable %}
{{ rows }}
- {% elseif empty %} + {% elseif empty is printable %}
{{ empty }}
{% endif %} - {% if pager %} + {% if pager is printable %} {{ pager }} {% endif %} - {% if attachment_after %} + {% if attachment_after is printable %}
{{ attachment_after }}
{% endif %} - {% if more %} + {% if more is printable %} {{ more }} {% endif %} - {% if footer %} + {% if footer is printable %} {% endif %} - {% if feed_icon %} + {% if feed_icon is printable %}
{{ feed_icon }}
diff --git a/core/modules/views_ui/templates/views-ui-display-tab-bucket.html.twig b/core/modules/views_ui/templates/views-ui-display-tab-bucket.html.twig index 50e925d..50c5596 100644 --- a/core/modules/views_ui/templates/views-ui-display-tab-bucket.html.twig +++ b/core/modules/views_ui/templates/views-ui-display-tab-bucket.html.twig @@ -15,11 +15,11 @@ */ #} - {% if title -%} + {% if title is printable -%}

{{ title }}

{%- endif %} {{ content }} - {% if actions -%} + {% if actions is printable -%} {{ actions }} {%- endif %}
diff --git a/core/modules/views_ui/templates/views-ui-display-tab-setting.html.twig b/core/modules/views_ui/templates/views-ui-display-tab-setting.html.twig index 1c67469..9fa9223 100644 --- a/core/modules/views_ui/templates/views-ui-display-tab-setting.html.twig +++ b/core/modules/views_ui/templates/views-ui-display-tab-setting.html.twig @@ -16,7 +16,7 @@ */ #} - {% if description -%} + {% if description is printable -%} {{ description }} {%- endif %} {% if settings_links %} diff --git a/core/modules/views_ui/templates/views-ui-view-preview-section.html.twig b/core/modules/views_ui/templates/views-ui-view-preview-section.html.twig index cfc840f..b8e2af3 100644 --- a/core/modules/views_ui/templates/views-ui-view-preview-section.html.twig +++ b/core/modules/views_ui/templates/views-ui-view-preview-section.html.twig @@ -14,7 +14,7 @@ */ #}

{{ title }}

-{% if links %} +{% if links is printable %}
{{ links }}
{% endif %}
{{ content }}
diff --git a/core/themes/bartik/templates/block--system-branding-block.html.twig b/core/themes/bartik/templates/block--system-branding-block.html.twig index c407fe3..f6bd56d 100644 --- a/core/themes/bartik/templates/block--system-branding-block.html.twig +++ b/core/themes/bartik/templates/block--system-branding-block.html.twig @@ -21,14 +21,14 @@ {{ 'Home'|t }} {% endif %} - {% if site_name or site_slogan %} + {% if site_name is printable or site_slogan is printable %}
- {% if site_name %} + {% if site_name is printable %} {{ site_name|e }} {% endif %} - {% if site_slogan %} + {% if site_slogan is printable %}
{{ site_slogan }}
{% endif %}
diff --git a/core/themes/bartik/templates/comment.html.twig b/core/themes/bartik/templates/comment.html.twig index b6d4bb9..d0c137d 100644 --- a/core/themes/bartik/templates/comment.html.twig +++ b/core/themes/bartik/templates/comment.html.twig @@ -85,7 +85,7 @@ // for accessibility. The list is difficult to navigate in a screen // reader without this information. #} - {% if parent %} + {% if parent is printable %}

{{ parent }}

@@ -113,7 +113,7 @@