-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #345 from openeuropa/OPENEUROPA-2431
OPENEUROPA-2431: Add pattern for text with featured media.
- Loading branch information
Showing
4 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
templates/patterns/text_featured_media/pattern-text-featured-media.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{# | ||
/** | ||
* @file | ||
* Text with featured media. | ||
*/ | ||
#} | ||
|
||
{% if title %} | ||
<h2 class="ecl-u-type-heading-2 ecl-u-mt-2xl ecl-u-mt-md-3xl ecl-u-mb-l">{{ title }}</h2> | ||
{% endif %} | ||
{% if image or text %} | ||
<div class="ecl-row"> | ||
{% if image %} | ||
<div class="ecl-col-12 ecl-col-md-6 ecl-u-order-md-last ecl-u-mb-l ecl-u-mb-md-none"> | ||
<figure class="ecl-media-container"> | ||
<img class="ecl-media-container__media" src="{{ image.src }}" alt="{{ image.alt }}"> | ||
{% if caption %} | ||
<figcaption class="ecl-media-container__caption">{{ caption }}</figcaption> | ||
{% endif %} | ||
</figure> | ||
</div> | ||
{% endif %} | ||
{% if text %} | ||
<div class="ecl-col-12{{ image is not empty ? ' ecl-col-md-6' }} ecl-editor">{{ text }}</div> | ||
{% endif %} | ||
</div> | ||
{% endif %} |
26 changes: 26 additions & 0 deletions
26
templates/patterns/text_featured_media/text_featured_media.ui_patterns.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
text_featured_media: | ||
label: "Text with Featured media" | ||
description: "Shows a rich text with a title and a featured media on the right, if any." | ||
fields: | ||
title: | ||
type: "text" | ||
label: "Title" | ||
description: "The title, displayed above text and media." | ||
preview: "Lorem ipsum" | ||
image: | ||
type: "ImageValueObject" | ||
label: "Image" | ||
description: "Image on the right of the text." | ||
preview: | ||
src: "https://placeimg.com/1000/500/arch" | ||
alt: "Alternative text for featured item image" | ||
caption: | ||
type: "text" | ||
label: "Caption" | ||
description: "Description of the image." | ||
preview: "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit." | ||
text: | ||
type: "text" | ||
label: "Full text" | ||
description: "The full rich text." | ||
preview: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Non enim iam stirpis bonum quaeret, sed animalis. Ego vero volo in virtute vim esse quam maximam; <b>A mene tu?</b> Quid, quod res alia tota est? Duo Reges: constructio interrete." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters