@openeuropa/bcl-featured-media 0.22.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,10 @@
2
2
 
3
3
  {# Parameters:
4
4
  - with_text (boolean) (default: false)
5
- - title: (string) (default: '')
6
- - title_tag: (string) (default: 'h2')
5
+ - title (string) (default: '')
6
+ - title_tag (string) (default: 'h2')
7
+ - title_link: (link object) (default: {})
8
+ - title_attributes: (drupal attrs)
7
9
  - image: (string) (default: "")
8
10
  - poster_image: (string) (default: "")
9
11
  - content: (string) (default: "")
@@ -34,6 +36,8 @@
34
36
 
35
37
  {% set _title = title|default('') %}
36
38
  {% set _title_tag = title_tag|default('h2') %}
39
+ {% set _title_link = title_link|default({}) %}
40
+ {% set _title_attributes = title_attributes ?: create_attribute() %}
37
41
  {% set _with_text = with_text|default(false) %}
38
42
  {% set _wrapper_classes = 'bcl-featured-item' %}
39
43
  {% set _description = description|default('') %}
@@ -57,19 +61,27 @@
57
61
  {% set attributes = create_attribute() %}
58
62
  {% endif %}
59
63
 
64
+ {% if _with_text %}
65
+ {% set _title_attributes = _title_attributes.addClass(['fw-bold', 'mb-4']) %}
66
+ {% endif %}
67
+
60
68
  {% set attributes = attributes.addClass(["rounded", "overflow-hidden"]) %}
61
69
 
62
70
  {% if _with_text %}
63
71
  <div class="{{ _wrapper_classes }}">
64
-
65
- {% if _title is not empty %}
66
- {% set _title_classes = 'fw-bold mb-4' %}
67
- <{{ _title_tag }} class="{{ _title_classes }}">
68
- {{- _title -}}
69
- </{{ _title_tag }}>
72
+ <div class="row">
70
73
  {% endif %}
71
74
 
72
- <div class="row">
75
+ {%- if _title is not empty -%}
76
+ {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
77
+ title: _title,
78
+ title_tag: _title_tag,
79
+ title_link: _title_link,
80
+ attributes: _title_attributes,
81
+ } only %}
82
+ {%- endif -%}
83
+
84
+ {% if _with_text %}
73
85
  <div class="{{ _col_classes }} order-{{ _alignment == "right" ? '1' : '2' }}">
74
86
  {{- _description|default('') -}}
75
87
 
package/package.json CHANGED
@@ -2,14 +2,14 @@
2
2
  "name": "@openeuropa/bcl-featured-media",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "0.22.0",
5
+ "version": "0.25.0",
6
6
  "description": "OE - BCL featured media",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
10
  "dependencies": {
11
- "@openeuropa/bcl-heading": "^0.22.0",
12
- "@openeuropa/bcl-link": "^0.22.0"
11
+ "@openeuropa/bcl-heading": "^0.25.0",
12
+ "@openeuropa/bcl-link": "^0.25.0"
13
13
  },
14
14
  "repository": {
15
15
  "type": "git",
@@ -25,5 +25,5 @@
25
25
  "design-system",
26
26
  "twig"
27
27
  ],
28
- "gitHead": "57304ad94ae3c234f2f2b904208ce540a7a53f23"
28
+ "gitHead": "f50c7dfeab8695bbb5c18d5f7d5304509512268a"
29
29
  }