From c606289fc43e9b44468dfbb557736f4d2e05f689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 13 Nov 2018 23:40:47 -0500 Subject: [PATCH] Provide alternate style for titlebar title paragraphs currently, it loses any image or subtitle, but could probably bring those back. Do style values the right way-- not as content, but grabbed from the entity. --- .../paragraph/paragraph--title.html.twig | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/agaric/templates/paragraph/paragraph--title.html.twig b/agaric/templates/paragraph/paragraph--title.html.twig index 955f75b..703d9d8 100644 --- a/agaric/templates/paragraph/paragraph--title.html.twig +++ b/agaric/templates/paragraph/paragraph--title.html.twig @@ -41,19 +41,22 @@ {% set classes = [ 'hero', - 'hero-project', - 'paragraph', 'paragraph--type--' ~ paragraph.bundle|clean_class, view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class, not paragraph.isPublished() ? 'paragraph--unpublished' ] %} -{% if content.field_style_color %} - {% set classes = classes|merge(['is-'~content.field_style_color|render|trim]) %} +{% if paragraph.field_style_color %} + {% set classes = classes|merge(['is-'~paragraph.field_style_color.value]) %} {% endif %} +{% if paragraph.field_style_titlebar is empty %} + {% set classes = classes|merge(['hero-project']) %} +{% endif %} + {% block paragraph %} {% block content %} + {% if paragraph.field_style_titlebar is empty %}
{{ content.field_image }} @@ -62,6 +65,18 @@ {{ content.field_title }} {{ content.field_subtitle }}
+
+ {% else %} +
+
+
+
+

{{ content.field_title }}

+
+
+
+
+ {% endif %} {% endblock %} {% endblock paragraph %}