diff --git a/agaric/templates/patterns/title_paragraph/pattern-title-paragraph.html.twig b/agaric/templates/patterns/title_paragraph/pattern-title-paragraph.html.twig index c799d02..0837dea 100644 --- a/agaric/templates/patterns/title_paragraph/pattern-title-paragraph.html.twig +++ b/agaric/templates/patterns/title_paragraph/pattern-title-paragraph.html.twig @@ -1,51 +1,30 @@ {# /** * @file - * Default theme implementation to display a one-column layout. + * Default theme implementation to display a pargraph section. * - * Available variables: - * - content: The content for this layout. - * - attributes: HTML attributes for the layout
. + * It extracts the title paragraph, if any, from a body paragraphs listing. * * @ingroup themeable */ #} -{{ dump(_context|keys) }} -
- -{% set bundle = content['#node'].bundle %} -{% set classes = [ 'is-child', 'card', 'card-project', 'hero-' ~ bundle|replace({"_": "-"}) ] %} -{# expected if statement would go here #} -{% set classes = classes|merge([ 'is-berry' ]) %} {% set title_paragraph_index = null %} {% set has_title_paragraph = false %} -{% if title.field_body_paragraph %} - Finally - {% for i, paragraph in title.field_body_paragraph if i|first != '#' %} - {% if title.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %} +{% if paragraphs.field_body_paragraph %} + {% for i, paragraph in paragraphs.field_body_paragraph if i|first != '#' %} + {% if paragraphs.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %} {% set has_title_paragraph = true %} {% set title_paragraph_index = i %} - Wow - {{ paragraph }} +
+ {{ paragraph }} +
{% endif %} {% endfor %} {% endif %} {% if not has_title_paragraph %} - - {# Header hero region #} -
-
- {{ content.title }} - buuuut you do have a title paragraph -
-

- {{ subtitle }} -

-
- + {% endif %} -