From 444194a4b898a858e18bb5a02751df2f420a13f3 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 16 May 2025 17:08:51 +0100 Subject: [PATCH] Add spacing between testimonials --- config/sync/views.view.testimonials.yml | 9 +++- .../views-view-list--testimonials.html.twig | 44 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 themes/opdavies/templates/views-view-list--testimonials.html.twig diff --git a/config/sync/views.view.testimonials.yml b/config/sync/views.view.testimonials.yml index c943d3ab0..d9e0a98ca 100644 --- a/config/sync/views.view.testimonials.yml +++ b/config/sync/views.view.testimonials.yml @@ -163,7 +163,14 @@ display: value: testimonial: testimonial style: - type: default + type: html_list + options: + row_class: '' + default_row_class: false + uses_fields: false + type: ul + wrapper_class: item-list + class: '' row: type: 'entity:node' options: diff --git a/themes/opdavies/templates/views-view-list--testimonials.html.twig b/themes/opdavies/templates/views-view-list--testimonials.html.twig new file mode 100644 index 000000000..1059220fe --- /dev/null +++ b/themes/opdavies/templates/views-view-list--testimonials.html.twig @@ -0,0 +1,44 @@ +{# +/** + * @file + * Default theme implementation for a view template to display a list of rows. + * + * Available variables: + * - attributes: HTML attributes for the container. + * - rows: A list of rows for this list. + * - attributes: The row's HTML attributes. + * - content: The row's contents. + * - title: The title of this group of rows. May be empty. + * - list: @todo. + * - type: Starting tag will be either a ul or ol. + * - attributes: HTML attributes for the list element. + * + * @see template_preprocess_views_view_list() + * + * @ingroup themeable + */ +#} +{% if attributes -%} + +{% endif %} + {% if title %} +

{{ title }}

+ {% endif %} + + {% set list_attributes = create_attribute({ + class: 'mt-4 space-y-12', + }) %} + + <{{ list.type }}{{ list_attributes }}> + + {% for row in rows %} + + {{- row.content -}} + + {% endfor %} + + + +{% if attributes -%} + +{% endif %}