@openeuropa/bcl-featured-media 1.1.1 → 1.2.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.
- package/featured-media.html.twig +20 -5
- package/package.json +4 -4
package/featured-media.html.twig
CHANGED
|
@@ -12,8 +12,12 @@
|
|
|
12
12
|
- poster_image: (string) (default: '')
|
|
13
13
|
- content: (string) (default: '')
|
|
14
14
|
- wrapper_classes: (default: '')
|
|
15
|
+
- force_wrapper (boolean) (default: false) - always render wrapper element
|
|
15
16
|
- content_classes: (string) (default: '')
|
|
16
17
|
- read_more (object) (default: {})
|
|
18
|
+
- description_title (string) (default: '')
|
|
19
|
+
- description_title_tag (string) (default: 'h3')
|
|
20
|
+
- description_title_attributes (drupal attrs)
|
|
17
21
|
- description (string) (default: '')
|
|
18
22
|
- ratio: (string) (default: '16x9')
|
|
19
23
|
- options ['1x1', '4x3', '16x9', '21x9']
|
|
@@ -40,6 +44,7 @@
|
|
|
40
44
|
{% set _title_tag = title_tag|default('h2') %}
|
|
41
45
|
{% set _title_link = title_link|default({}) %}
|
|
42
46
|
{% set _title_attributes = title_attributes ?: create_attribute() %}
|
|
47
|
+
{% set _force_wrapper = force_wrapper ?? false %}
|
|
43
48
|
{% set _with_text = with_text ?? false %}
|
|
44
49
|
{% set _alignment = alignment|default('right') %}
|
|
45
50
|
{% set _image = image|default('') %}
|
|
@@ -48,6 +53,9 @@
|
|
|
48
53
|
{% set _wrapper_classes = wrapper_classes|default('') %}
|
|
49
54
|
{% set _content_classes = content_classes|default('') %}
|
|
50
55
|
{% set _read_more = read_more|default({}) %}
|
|
56
|
+
{% set _description_title = description_title|default('') %}
|
|
57
|
+
{% set _description_title_tag = description_title_tag|default('h3') %}
|
|
58
|
+
{% set _description_title_attributes = description_title_attributes ?: create_attribute() %}
|
|
51
59
|
{% set _description = description|default('') %}
|
|
52
60
|
{% set _ratio = ratio|default('16x9') %}
|
|
53
61
|
{% set _sources = sources|default([]) %}
|
|
@@ -65,10 +73,6 @@
|
|
|
65
73
|
{% set attributes = create_attribute() %}
|
|
66
74
|
{% endif %}
|
|
67
75
|
|
|
68
|
-
{% if _with_text %}
|
|
69
|
-
{% set _title_attributes = _title_attributes.addClass(['fw-bold', 'mb-4']) %}
|
|
70
|
-
{% endif %}
|
|
71
|
-
|
|
72
76
|
{% set attributes = attributes.addClass(["rounded", "overflow-hidden"]) %}
|
|
73
77
|
|
|
74
78
|
{% if _image is not empty %}
|
|
@@ -80,8 +84,10 @@
|
|
|
80
84
|
{% endif %}
|
|
81
85
|
{% endif %}
|
|
82
86
|
|
|
83
|
-
{% if _with_text %}
|
|
87
|
+
{% if _with_text or _force_wrapper %}
|
|
84
88
|
<div class="{{ _classes }}">
|
|
89
|
+
{% endif %}
|
|
90
|
+
{% if _with_text %}
|
|
85
91
|
<div class="row">
|
|
86
92
|
{% endif %}
|
|
87
93
|
|
|
@@ -96,6 +102,13 @@
|
|
|
96
102
|
|
|
97
103
|
{% if _with_text %}
|
|
98
104
|
<div class="{{ _col_classes }} order-{{ _alignment == "right" ? '1' : '2' }}">
|
|
105
|
+
{%- if _description_title is not empty -%}
|
|
106
|
+
{% include '@oe-bcl/bcl-heading/heading.html.twig' with {
|
|
107
|
+
title: _description_title,
|
|
108
|
+
title_tag: _description_title_tag,
|
|
109
|
+
attributes: _description_title_attributes,
|
|
110
|
+
} only %}
|
|
111
|
+
{%- endif -%}
|
|
99
112
|
{{- _description|default('') -}}
|
|
100
113
|
|
|
101
114
|
{% if _read_more is not empty %}
|
|
@@ -151,6 +164,8 @@
|
|
|
151
164
|
{% if _with_text %}
|
|
152
165
|
</div>
|
|
153
166
|
</div>
|
|
167
|
+
{% endif %}
|
|
168
|
+
{% if _with_text or _force_wrapper %}
|
|
154
169
|
</div>
|
|
155
170
|
{% endif %}
|
|
156
171
|
|
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": "1.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"description": "OE - BCL featured media",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-heading": "^1.
|
|
12
|
-
"@openeuropa/bcl-link": "^1.
|
|
11
|
+
"@openeuropa/bcl-heading": "^1.2.0",
|
|
12
|
+
"@openeuropa/bcl-link": "^1.2.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": "
|
|
28
|
+
"gitHead": "e8750bd56d83523370a6a1f32f3cc5c0b14bdfca"
|
|
29
29
|
}
|