From edf59ef2452eeba549de8898a90e899f9838c9fa Mon Sep 17 00:00:00 2001 From: Martin Leblanc <m26lebla@uwaterloo.ca> Date: Tue, 8 Nov 2022 11:00:21 -0500 Subject: [PATCH] ISTWCMS-5880: adding logic to print a second page title only when in layout builder when editing a node with media(hijacking the title) --- .../blocks/block--page-title-block.html.twig | 60 +++++-------------- 1 file changed, 15 insertions(+), 45 deletions(-) diff --git a/templates/blocks/block--page-title-block.html.twig b/templates/blocks/block--page-title-block.html.twig index 899a3054..564b2fcf 100644 --- a/templates/blocks/block--page-title-block.html.twig +++ b/templates/blocks/block--page-title-block.html.twig @@ -1,16 +1,23 @@ {% if show_title is not defined %} {% set show_title = TRUE %} {% endif %} +{% + set classes = [ + 'block', + 'block-' ~ configuration.provider|clean_class, + 'block-' ~ plugin_id|clean_class, +] +%} +{#This is to show the title to the user at top of page inside the collapsable area, when doing the updates in layout builder#} +{% if not show_title and in_layout_builder %} + <div{{ attributes.addClass(classes) }}> + {% block page_title_content %} + {{ content }} + {% endblock %} + </div> +{% endif %} {% if show_title %} - {% - set classes = [ - 'block', - 'block-' ~ configuration.provider|clean_class, - 'block-' ~ plugin_id|clean_class, - ] - %} - <div{{ attributes.addClass(classes) }}> {% if admin_label %} <div class="uw-admin-label">{{ admin_label }}</div> @@ -25,40 +32,3 @@ {% endblock %} </div> {% endif %} -{# // OHANA // OHANA // OHANA // OHANA - -/** - * @file - * Theme override for page title block. - */ - - -{% set classes = [ - 'l-block--provider-' ~ configuration.provider|clean_class, - 'l-block--id-' ~ plugin_id|clean_class, -] %} - -{% set attributes = attributes.addClass(classes) %} - -{% embed '@layouts/block/block.twig' with { - 'attributes': attributes, - 'block_wrapper': true, - 'constrain': '', - 'title_prefix': title_prefix, - 'title_suffix': title_suffix, - 'label': label is not empty ? label : false, - 'content_wrapper': true -} %} - - {% block content %} - {% include '@components/page-title/page-title.twig' with { - 'page_title': content['#title'] - } %} - {% endblock %} - -{% endembed %} - - - - OHANA // OHANA // OHANA // OHANA #} - -- GitLab