Skip to content

Commit

Permalink
Merge pull request #134 from nysenate/feature/nys-15838--slider
Browse files Browse the repository at this point in the history
Cleans up slider component
  • Loading branch information
kzalewski authored Feb 15, 2024
2 parents b857a0a + 68a58a3 commit c954fdb
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 284 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ langcode: en
status: true
dependencies:
config:
- field.field.paragraph.slider_item.field_link
- field.field.paragraph.slider_item.field_media
- field.field.paragraph.slider_item.field_subhead
- field.field.paragraph.slider_item.field_summary
- field.field.paragraph.slider_item.field_title
- paragraphs.paragraphs_type.slider_item
module:
- link
- media_library
_core:
default_config_hash: FNlIGpC1xngsFl4CDnZFULys0RJuQmkcProE1Fp-SIc
Expand All @@ -19,45 +14,13 @@ targetEntityType: paragraph
bundle: slider_item
mode: default
content:
field_link:
type: link_default
weight: 4
region: content
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
field_media:
type: media_library_widget
weight: 2
region: content
settings:
media_types: { }
third_party_settings: { }
field_subhead:
type: string_textfield
weight: 1
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_summary:
type: string_textarea
weight: 3
region: content
settings:
rows: 5
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ content:
region: content
field_title:
type: string
label: above
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,15 @@ langcode: en
status: true
dependencies:
config:
- field.field.paragraph.slider_item.field_link
- field.field.paragraph.slider_item.field_media
- field.field.paragraph.slider_item.field_subhead
- field.field.paragraph.slider_item.field_summary
- field.field.paragraph.slider_item.field_title
- paragraphs.paragraphs_type.slider_item
module:
- link
_core:
default_config_hash: kYkCQyu6xDkZiu0L8x4ou95oWkMPIE82UqR0mFmj0d8
id: paragraph.slider_item.default
targetEntityType: paragraph
bundle: slider_item
mode: default
content:
field_link:
type: link
label: hidden
settings:
trim_length: 80
url_only: false
url_plain: false
rel: ''
target: ''
third_party_settings: { }
weight: 2
region: content
field_media:
type: entity_reference_entity_view
label: hidden
Expand All @@ -39,29 +21,6 @@ content:
third_party_settings: { }
weight: 1
region: content
field_subhead:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 3
region: content
field_summary:
type: basic_string
label: hidden
settings: { }
third_party_settings: { }
weight: 4
region: content
field_title:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 0
region: content
hidden:
entity_print_view_epub: true
entity_print_view_pdf: true
Expand Down
2 changes: 1 addition & 1 deletion config/sync/crop.type.main_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ uuid: d41ce67d-ce52-4be6-8470-9416bc360cc8
langcode: en
status: true
dependencies: { }
label: 'Main Image'
label: 'Main Image (or Slider images)'
id: main_image
description: ''
aspect_ratio: '2:1'
Expand Down
25 changes: 0 additions & 25 deletions config/sync/field.field.paragraph.slider_item.field_link.yml

This file was deleted.

2 changes: 0 additions & 2 deletions config/sync/field.field.paragraph.slider_item.field_media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
config:
- field.storage.paragraph.field_media
- media.type.image
- media.type.video
- paragraphs.paragraphs_type.slider_item
_core:
default_config_hash: 07ZXXR9WkYOSLQv5TLNKFq1pPdlQJjPWm-v0FtrGXYU
Expand All @@ -24,7 +23,6 @@ settings:
handler_settings:
target_bundles:
image: image
video: video
sort:
field: _none
direction: ASC
Expand Down
21 changes: 0 additions & 21 deletions config/sync/field.field.paragraph.slider_item.field_subhead.yml

This file was deleted.

21 changes: 0 additions & 21 deletions config/sync/field.field.paragraph.slider_item.field_summary.yml

This file was deleted.

21 changes: 0 additions & 21 deletions config/sync/field.field.paragraph.slider_item.field_title.yml

This file was deleted.

4 changes: 4 additions & 0 deletions config/sync/field.storage.paragraph.field_media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ langcode: en
status: true
dependencies:
module:
- field_permissions
- media
- paragraphs
third_party_settings:
field_permissions:
permission_type: public
_core:
default_config_hash: wa_nFwSP5949t2qfxB3fcBdCkaB3eFjMowkhLytP5BI
id: paragraph.field_media
Expand Down
39 changes: 0 additions & 39 deletions web/themes/custom/nysenate_theme/nysenate_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -69,45 +69,6 @@ function nysenate_theme_preprocess_block__system_branding_block(&$variables) {
];
}

/**
* Implements hook_preprocess_block_ID().
*/
function nysenate_theme_preprocess_block_content__how_senate_works(&$variables) {
if (!empty($variables['elements']['field_link'][0])) {
$variables['cta'] = [
'text' => $variables['elements']['field_link'][0]['#title'],
'link' => $variables['elements']['field_link'][0]['#url']->toString(),
];
}

$steps = [];
foreach ($variables['elements']['field_steps'] as $key => $items) {
if (!is_numeric($key)) {
continue;
}

$title = '';
$description = '';

if ($items['#paragraph']->field_title->getValue()) {
$title = $items['#paragraph']->field_title->getValue();
$title = reset($title)['value'];
}

if ($items['#paragraph']->field_description->getValue()) {
$description = $items['#paragraph']->field_description->getValue();
$description = reset($description)['value'];
}

$steps[] = [
'title' => $title,
'description' => $description,
];
}

$variables['steps'] = $steps;
}

/**
* Implements hook_preprocess_node_TYPE().
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="carousel-item__media">
{%
include '@nysenate_theme/media/media.twig' with {
"image": item,
"image": image,
} only
%}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{ attach_library('nysenate_theme/carousel') }}

<div class="carousel__wrapper{{ attributes ? ' ' ~ attributes.class}}"
{{- attributes ? attributes|without(class) -}}>
<section class="carousel__wrapper{{ attributes ? ' ' ~ attributes.class}}"
{{- attributes ? attributes|without(class) -}}>
<ul class="carousel__list carousel__slick">
{% block carousel_items %}
{% for i in list['#items'] %}
{% for item in list %}
{%
include '@nysenate_theme/nysenate-carousel/_carousel-item.twig' with {
"item": list[loop.index0]
} only
"item": item
} only
%}
{% endfor %}
{% endblock %}
</ul>
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ body {
margin-top: 40px;
}
}

h2.pg-subtitle {
font-family: $font-serif;
font-size: 30px;
color: #444444;
}
}

.c-block .c-img--caption {
Expand Down Expand Up @@ -180,6 +186,8 @@ body {
}
}



@include breakpoint($bp-sm) {
.c-block-legislation .c-block--btn-toggle {
height: 42px;
Expand Down
Loading

0 comments on commit c954fdb

Please sign in to comment.