-
Notifications
You must be signed in to change notification settings - Fork 1
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 #405 from itk-dev/feature/1289-files-paragraph
Files paragraph
- Loading branch information
Showing
12 changed files
with
190 additions
and
2 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
34 changes: 34 additions & 0 deletions
34
config/sync/core.entity_form_display.paragraph.files.default.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,34 @@ | ||
uuid: 458df720-e0e0-4169-bdcb-c3b73826dfaf | ||
langcode: da | ||
status: true | ||
dependencies: | ||
config: | ||
- field.field.paragraph.files.field_files | ||
- field.field.paragraph.files.field_title | ||
- paragraphs.paragraphs_type.files | ||
id: paragraph.files.default | ||
targetEntityType: paragraph | ||
bundle: files | ||
mode: default | ||
content: | ||
field_files: | ||
type: entity_reference_autocomplete | ||
weight: 1 | ||
region: content | ||
settings: | ||
match_operator: CONTAINS | ||
match_limit: 10 | ||
size: 60 | ||
placeholder: '' | ||
third_party_settings: { } | ||
field_title: | ||
type: string_textfield | ||
weight: 0 | ||
region: content | ||
settings: | ||
size: 60 | ||
placeholder: '' | ||
third_party_settings: { } | ||
hidden: | ||
created: true | ||
status: true |
31 changes: 31 additions & 0 deletions
31
config/sync/core.entity_view_display.paragraph.files.default.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,31 @@ | ||
uuid: 007ebc45-761d-4581-bec4-1a3746342f72 | ||
langcode: da | ||
status: true | ||
dependencies: | ||
config: | ||
- field.field.paragraph.files.field_files | ||
- field.field.paragraph.files.field_title | ||
- paragraphs.paragraphs_type.files | ||
id: paragraph.files.default | ||
targetEntityType: paragraph | ||
bundle: files | ||
mode: default | ||
content: | ||
field_files: | ||
type: entity_reference_entity_view | ||
label: hidden | ||
settings: | ||
view_mode: material_display | ||
link: false | ||
third_party_settings: { } | ||
weight: 1 | ||
region: content | ||
field_title: | ||
type: string | ||
label: hidden | ||
settings: | ||
link_to_entity: false | ||
third_party_settings: { } | ||
weight: 0 | ||
region: content | ||
hidden: { } |
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
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
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,31 @@ | ||
uuid: 6ea32cf8-12f7-4989-b7c0-b3c6fe0f5887 | ||
langcode: da | ||
status: true | ||
dependencies: | ||
config: | ||
- field.storage.paragraph.field_files | ||
- media.type.document | ||
- media.type.image | ||
- paragraphs.paragraphs_type.files | ||
id: paragraph.files.field_files | ||
field_name: field_files | ||
entity_type: paragraph | ||
bundle: files | ||
label: Files | ||
description: 'Used to reference the files' | ||
required: false | ||
translatable: false | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: | ||
handler: 'default:media' | ||
handler_settings: | ||
target_bundles: | ||
image: image | ||
document: document | ||
sort: | ||
field: _none | ||
direction: ASC | ||
auto_create: false | ||
auto_create_bundle: image | ||
field_type: entity_reference |
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,19 @@ | ||
uuid: 57f24aa7-0238-4330-8266-f6c9e9307704 | ||
langcode: da | ||
status: true | ||
dependencies: | ||
config: | ||
- field.storage.paragraph.field_title | ||
- paragraphs.paragraphs_type.files | ||
id: paragraph.files.field_title | ||
field_name: field_title | ||
entity_type: paragraph | ||
bundle: files | ||
label: Title | ||
description: 'Used for the title' | ||
required: false | ||
translatable: false | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: { } | ||
field_type: string |
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,20 @@ | ||
uuid: b3aa2101-054f-4c60-821b-3b39df4efe02 | ||
langcode: da | ||
status: true | ||
dependencies: | ||
module: | ||
- media | ||
- paragraphs | ||
id: paragraph.field_files | ||
field_name: field_files | ||
entity_type: paragraph | ||
type: entity_reference | ||
settings: | ||
target_type: media | ||
module: core | ||
locked: false | ||
cardinality: -1 | ||
translatable: true | ||
indexes: { } | ||
persist_with_no_fields: false | ||
custom_storage: false |
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,10 @@ | ||
uuid: 50378b6f-ed0f-41ae-98af-1afa956943b0 | ||
langcode: da | ||
status: true | ||
dependencies: { } | ||
id: files | ||
label: Files | ||
icon_uuid: null | ||
icon_default: null | ||
description: 'Used to upload files that the user can download' | ||
behavior_plugins: { } |
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
14 changes: 14 additions & 0 deletions
14
web/themes/custom/hoeringsportal/assets/css/module/_paragraph-files.scss
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,14 @@ | ||
.paragraph-files article { | ||
background-color: $color-petroleum-100; | ||
padding: $spacer; | ||
margin-bottom: calc($spacer * 0.25); | ||
display: flex; | ||
} | ||
|
||
.paragraph-files article svg { | ||
order: 1; | ||
} | ||
|
||
.paragraph-files article span { | ||
order: 2; | ||
} |
18 changes: 18 additions & 0 deletions
18
web/themes/custom/hoeringsportal/templates/paragraph/paragraph--files.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,18 @@ | ||
{# Paragraph for exposing downloadable files #} | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
{% block paragraph %} | ||
{% if content.field_title['#items'] is not empty %} | ||
<h2>{{ content.field_title }}</h2> | ||
{% endif %} | ||
{% block content %} | ||
<div class="paragraph-files d-flex flex-column"> | ||
{{ content|without('field_title') }} | ||
</div> | ||
{% endblock %} | ||
{% endblock paragraph %} | ||
</div> | ||
</div> | ||
</div> |