Skip to content

Commit

Permalink
EWPP-4750: Use extra_attributes in highlighted_list pattern template.
Browse files Browse the repository at this point in the history
  • Loading branch information
22Alexandra committed Oct 10, 2024
1 parent 0b3fd2c commit ed4e648
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'image_position': (loop.first or loop.index == 4) ? 'top' : '',
'divider': (loop.index == 2 or loop.index == 5) ? true : false,
'extra_classes': (loop.index == 2 or loop.index == 5) ? 'ecl-u-flex-grow-1 ecl-u-mb-m' : 'ecl-u-flex-grow-1',
'extra_attributes': item.extra_attributes|default([]),
}, 'default') %}
{% set _items = _items|merge([_item]) %}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'image_position': 'top',
'divider': true,
'extra_classes': 'ecl-u-flex-grow-1',
'extra_attributes': highlighted_item.extra_attributes|default([]),
}, 'default') %}
{% endif %}

Expand All @@ -44,6 +45,7 @@
'image_position': loop.first ? 'top' : '',
'divider': true,
'extra_classes': loop.last ? 'ecl-u-flex-grow-1' : 'ecl-u-flex-grow-1 ecl-u-mb-m',
'extra_attributes': item.extra_attributes|default([]),
}, 'default') %}
{% set _items = _items|merge([_item]) %}
{% endfor %}
Expand Down
14 changes: 12 additions & 2 deletions tests/src/Kernel/fixtures/rendering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4581,6 +4581,9 @@
image:
src: "https://loremflickr.com/1200/900/arch"
alt: "Highlighted item image"
extra_attributes:
- name: "extra-attr1"
value: "extra value1"
items:
- title: "Item 2"
detail: "Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem."
Expand All @@ -4593,6 +4596,9 @@
image:
src: "https://loremflickr.com/1200/900/arch"
alt: "Item 2 image"
extra_attributes:
- name: "extra-attr2"
value: "extra value2"
- title: "Item 3"
url: "https://external.com"
detail: "In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam"
Expand Down Expand Up @@ -4646,8 +4652,8 @@
'div.ecl-content-block__title': 4
'div.ecl-content-block__title a': 3
'picture.ecl-content-item__picture': 2
'div.ecl-col-l-8 picture.ecl-content-item__picture--large img.ecl-content-item__image[src="https://loremflickr.com/1200/900/arch"][alt="Highlighted item image"]': 1
'div.ecl-col-l-4 picture.ecl-content-item__picture--medium img.ecl-content-item__image[src="https://loremflickr.com/1200/900/arch"][alt="Item 2 image"]': 1
'div.ecl-col-l-8 article.ecl-content-item[extra-attr1="extra value1"] picture.ecl-content-item__picture--large img.ecl-content-item__image[src="https://loremflickr.com/1200/900/arch"][alt="Highlighted item image"]': 1
'div.ecl-col-l-4 article.ecl-content-item[extra-attr2="extra value2"] picture.ecl-content-item__picture--medium img.ecl-content-item__image[src="https://loremflickr.com/1200/900/arch"][alt="Item 2 image"]': 1
'div#highlighted-news-block div.ecl-col-l-8 a': 1
'div#highlighted-news-block div.ecl-col-l-4 a': 2
'ul.ecl-content-block__primary-meta-container': 4
Expand Down Expand Up @@ -4817,6 +4823,9 @@
definition: "Thursday 15 November, 08:00 AM to Friday 16 November"
- term: "Where"
definition: "The EGG, Rue Barra 175, 1070 Brussels, Belgium"
extra_attributes:
- name: "extra-attr1"
value: "extra value1"
- title: "In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo"
url: "https://external.com"
detail: "In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam"
Expand Down Expand Up @@ -4879,6 +4888,7 @@
'div div.ecl-row.ecl-u-border-color-neutral.ecl-u-border-width-1.ecl-u-border-bottom.ecl-u-pb-l': 1
'div.ecl-row div.ecl-col-l-3.ecl-u-d-flex.ecl-u-flex-column': 4
'div.ecl-row article.ecl-content-item.ecl-u-flex-grow-1': 6
'div.ecl-row article.ecl-content-item[extra-attr1="extra value1"].ecl-u-flex-grow-1': 1
'div.ecl-row article.ecl-content-item--divider.ecl-u-flex-grow-1.ecl-u-mb-m': 2
'div.ecl-content-block__title': 6
'div.ecl-content-block__title a': 4
Expand Down

0 comments on commit ed4e648

Please sign in to comment.