Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EWPP-4496: Add Introduction field to various patterns. #1477

Merged
merged 5 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"openeuropa/behat-transformation-context": "^0.2",
"openeuropa/code-review": "^2.0.0-alpha6",
"openeuropa/oe_contact_forms": "^1.14",
"openeuropa/oe_content": "^3.0.0",
"openeuropa/oe_content": "^4.0.0",
"openeuropa/oe_corporate_blocks": "^4.19",
"openeuropa/oe_corporate_countries": "^2.0.0",
"openeuropa/oe_corporate_site_info": "^1.0.0-alpha8",
Expand All @@ -70,6 +70,9 @@
}
},
"autoload-dev": {
"classmap": [
"build/core/modules/field/tests/src/Traits/EntityReferenceFieldCreationTrait.php"
],
"psr-4": {
"Drupal\\Tests\\oe_theme\\": "./tests/src/",
"Drupal\\Tests\\oe_content\\": "./build/modules/contrib/oe_content/tests/src/",
Expand Down Expand Up @@ -113,7 +116,8 @@
},
"_readme": [
"behat/mink-selenium2-driver locked to 1.6.x as version 1.7.0 introduces issues with mouse dragging and keyboard key events.",
"Explicit requirement of nikic/php-parser as ^5.0 generates GrumPHP Parser issues."
"Explicit requirement of nikic/php-parser as ^5.0 generates GrumPHP Parser issues.",
"autoload-dev: explicitly mapping EntityReferenceFieldCreationTrait to prevent failures."
]
},
"config": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{% apply spaceless %}

{#
/**
* @file
* Theme implementation for a ECL Content Item Block.
*/
Parameters:
- "type" (string) (default: 'one'): Type of Content Item Block
- "title" (string) (default: ''): Title of Content Item Block
- "items" (array) (default: []): Content Item's for the Content Item Block
- "button" (associative array) (default: {}): Predefined structure compatible with Link component.
- "extra_classes" (string) (default: '')
- "extra_attributes" (array) (default: []): format: [
{
"name" (string) (default: ''),
"value" (string) (default: '')
},
...
]
/**
* @file
* Theme implementation for a ECL Content Item Block.
*/
Parameters:
- "type" (string) (default: 'one'): Type of Content Item Block
- "title" (string) (default: ''): Title of Content Item Block
- "introduction" (string) (default: ''): A brief summary of the block.
- "items" (array) (default: []): Content Item's for the Content Item Block
- "button" (associative array) (default: {}): Predefined structure compatible with Link component.
- "extra_classes" (string) (default: '')
- "extra_attributes" (array) (default: []): format: [
{
"name" (string) (default: ''),
"value" (string) (default: '')
},
...
]
#}

{# Internal properties #}
Expand All @@ -26,6 +27,7 @@
{% set _extra_attributes = '' %}
{% set _type = type|default('one') %}
{% set _title = title|default('') %}
{% set _introduction = introduction|default('') %}
{% set _items = items|default([]) %}
{% set _button = button|default({}) %}

Expand Down Expand Up @@ -61,6 +63,14 @@
</div>
{% endif %}

{% if _introduction %}
<div class="ecl-row">
<div class="ecl-content-item-block__introduction ecl ecl-u-mb-2xl ecl-col-12">
{{ _introduction }}
</div>
</div>
{% endif %}

<div class="ecl-row">
{% if vertical %}
{% set items_per_column = _items|length/_type %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Parameters:
- "columns" (int) (default: 2): The number of columns layout. It can be 2 or 4 and it defaults to 2.
- "title" (string) (default: ''): The Highlighted News Block title.
- "introduction" (string) (default: ''): A brief summary of the block content.
- "highlighted" (array) (default: []): The main item of the list compatible with the ECL Content Item component.
- "items" (array) (default: []): Highlighted News items compatible with the ECL Content Item component.
- "see_more" (array) (default: []): Predefined structure compatible with Link component.
Expand All @@ -19,6 +20,13 @@
</div>
</div>
{% endif %}
{% if introduction is not empty %}
<div class="ecl-row">
<div class="ecl-content-item-block__introduction ecl ecl-u-mb-2xl ecl-col-12">
{{ introduction }}
</div>
</div>
{% endif %}
{% if highlighted is not empty and items is not empty and _columns == 2 %}
<div class="ecl-row">
<div class="ecl-col-l-8 ecl-u-d-flex ecl-u-flex-column contextual-region">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div id="project-funding" class="ecl-u-mt-3xl">
{% if title %}
<h2 class="ecl-u-type-heading-2">
{{ title|t }}
{{ title|render|t }}
</h2>
{% endif %}
{{ element }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#}
<div id="project-results" class="ecl-u-mt-3xl">
{% if title %}
<h2 class="ecl-u-type-heading-2">{{ title|t }}</h2>
<h2 class="ecl-u-type-heading-2">{{ title|render|t }}</h2>
{% endif %}
<div class="ecl-row ecl-u-mb-l">
<div class="ecl-col-m-6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="project-stakeholders" class="ecl-u-mt-3xl">
{% if title %}
<h2 class="ecl-u-type-heading-2">
{{ title|t }}
{{ title|render|t }}
</h2>
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ highlighted_list:
label: "Title"
description: "Highlighted list title"
preview: "Highlighted News"
introduction:
type: "text"
label: "Introduction"
description: "A brief summary of the content on the list."
preview:
'#markup': "<p>Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed cursus turpis vitae tortor. <strong>Aliquam eu nunc.</strong> Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Fusce egestas elit eget lorem.</p>"
highlighted_item:
type: "array"
label: "Highlighted item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
{% include '@oe_theme/compositions/ec-component-highlighted-news-block/highlighted-news-block.html.twig' with {
'columns': 4,
'title': title|default(''),
'introduction': introduction|default(''),
'items': _items,
'see_more': _see_more,
'detail': detail|default(''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

{% include '@oe_theme/compositions/ec-component-highlighted-news-block/highlighted-news-block.html.twig' with {
'title': title|default(''),
'introduction': introduction|default(''),
'highlighted': _highlighted_item|default([]),
'items': _items,
'see_more': _see_more,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ list_item_block_four_columns:
label: "Title"
description: "Block title"
preview: "The European Commission's priorities"
introduction:
type: "text"
label: "Introduction"
description: "A brief summary of the content on the list."
preview:
'#markup': "<p>The European Commission focuses on <strong>several key areas:</strong> supporting the EU economy and businesses, and providing guidance on living, working and traveling in the EU. Read more about our priorities.</p>"
items:
type: "array"
label: "Layout items"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ list_item_block_one_column:
label: "Title"
description: "Block title"
preview: "The European Commission's priorities"
introduction:
type: "text"
label: "Introduction"
description: "A brief summary of the content on the list."
preview:
'#markup': "<p>The European Commission focuses on <strong>several key areas:</strong> supporting the EU economy and businesses, and providing guidance on living, working and traveling in the EU. Read more about our priorities.</p>"
items:
type: "array"
label: "Layout items"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ list_item_block_six_columns:
label: "Title"
description: "Block title"
preview: "The European Commission's priorities"
introduction:
type: "text"
label: "Introduction"
description: "A brief summary of the content on the list."
preview:
'#markup': "<p>The European Commission focuses on <strong>several key areas:</strong> supporting the EU economy and businesses, and providing guidance on living, working and traveling in the EU. Read more about our priorities.</p>"
items:
type: "array"
label: "Layout items"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ list_item_block_three_columns:
label: "Title"
description: "Block title"
preview: "The European Commission's priorities"
introduction:
type: "text"
label: "Introduction"
description: "A brief summary of the content on the list."
preview:
'#markup': "<p>The European Commission focuses on <strong>several key areas:</strong> supporting the EU economy and businesses, and providing guidance on living, working and traveling in the EU. Read more about our priorities.</p>"
items:
type: "array"
label: "Layout items"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ list_item_block_two_columns:
label: "Title"
description: "Block title"
preview: "The European Commission's priorities"
introduction:
type: "text"
label: "Introduction"
description: "A brief summary of the content on the list."
preview:
'#markup': "<p>The European Commission focuses on <strong>several key areas:</strong> supporting the EU economy and businesses, and providing guidance on living, working and traveling in the EU. Read more about our priorities.</p>"
items:
type: "array"
label: "Layout items"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{% include '@oe_theme/compositions/ec-component-content-item-block/content-item-block.html.twig' with {
type: 4,
title: title,
introduction: introduction,
items: items,
icon_path: ecl_icon_path,
button: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{% include '@oe_theme/compositions/ec-component-content-item-block/content-item-block.html.twig' with {
type: 1,
title: title,
introduction: introduction,
items: items,
icon_path: ecl_icon_path,
button: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{% include '@oe_theme/compositions/ec-component-content-item-block/content-item-block.html.twig' with {
type: 6,
title: title,
introduction: introduction,
items: items,
icon_path: ecl_icon_path,
button: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{% include '@oe_theme/compositions/ec-component-content-item-block/content-item-block.html.twig' with {
type: 3,
title: title,
introduction: introduction,
items: items,
icon_path: ecl_icon_path,
button: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{% include '@oe_theme/compositions/ec-component-content-item-block/content-item-block.html.twig' with {
type: 2,
title: title,
introduction: introduction,
items: items,
icon_path: ecl_icon_path,
button: {
Expand Down
Loading