Skip to content

Commit

Permalink
OEL-779: Banner minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
escuriola committed Jan 19, 2022
1 parent 9e867be commit 2412092
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions templates/paragraphs/paragraph--oe-banner.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#}
{% set attributes = create_attribute() %}
{% if url %}
{% set _link = {
{% set _call_to_action = {
'label': label,
'path': url,
'attributes': create_attribute({
Expand All @@ -30,7 +30,7 @@
'variant': variant,
'title': content.field_oe_title,
'description': content.field_oe_text,
'link': _link,
'call_to_action': _call_to_action,
'image': image.src,
'hero': _hero,
'shade': _shade,
Expand Down
4 changes: 2 additions & 2 deletions templates/patterns/banner/banner.ui_patterns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ banner:
label: 'Description'
description: 'Sub-heading of the banner.'
preview: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
type: array
label: 'Link'
label: 'Call to action'
description: 'Link to print a CTA button. Optional.'
preview:
label: 'Subscribe'
Expand Down
8 changes: 4 additions & 4 deletions templates/patterns/banner/pattern-banner.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
{% if centered %}
{% set attributes = attributes.addClass(['text-center'])%}
{% endif %}
{% if link %}
{% set link = link|merge(
{'variant': link.link_style}
{% if call_to_action %}
{% set call_to_action = call_to_action|merge(
{'variant': call_to_action.link_style}
) %}
{% endif %}
{% include '@oe-bcl/banner' with {
Expand All @@ -26,7 +26,7 @@
centered: centered,
title: title,
description: description,
link: link,
link: call_to_action,
image: variant == 'image' or variant == 'image_shade' ? image : '' ,
content_classes: content_classes,
attributes: attributes,
Expand Down
48 changes: 24 additions & 24 deletions tests/src/Kernel/fixtures/markup_rendering_patterns/banner.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default_page_banner_centered_with_link_full_width:
default_page_banner_centered_with_call_to_action_full_width:
render:
'#type': pattern
'#id': banner
Expand All @@ -11,7 +11,7 @@ default_page_banner_centered_with_link_full_width:
centered: true
title: 'EU Budget for the future'
description: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
label: 'Subscribe'
path: 'https://example.com'
assertions:
Expand All @@ -29,7 +29,7 @@ default_page_banner_centered_with_link_full_width:
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
equals:
'.bcl-banner__content a[href="https://example.com"]': 'Subscribe'
default_page_banner_aligned_left_without_link:
default_page_banner_aligned_left_without_call_to_action:
render:
'#type': pattern
'#id': banner
Expand All @@ -55,7 +55,7 @@ default_page_banner_aligned_left_without_link:
contains:
'.bcl-banner__content div': 'EU Budget for the future'
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
default_page_hero_banner_aligned_left_without_link_full_width:
default_page_hero_banner_aligned_left_without_call_to_action_full_width:
render:
'#type': pattern
'#id': banner
Expand All @@ -81,7 +81,7 @@ default_page_hero_banner_aligned_left_without_link_full_width:
contains:
'.bcl-banner__content div': 'EU Budget for the future'
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
default_page_hero_banner_centered_with_link:
default_page_hero_banner_centered_with_call_to_action:
render:
'#type': pattern
'#id': banner
Expand All @@ -94,7 +94,7 @@ default_page_hero_banner_centered_with_link:
centered: true
title: 'EU Budget for the future'
description: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
label: 'Subscribe'
path: 'https://example.com'
assertions:
Expand All @@ -112,7 +112,7 @@ default_page_hero_banner_centered_with_link:
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
equals:
'.bcl-banner__content a[href="https://example.com"]': 'Subscribe'
primary_page_banner_centered_with_link_full_width:
primary_page_banner_centered_with_call_to_action_full_width:
render:
'#type': pattern
'#id': banner
Expand All @@ -125,7 +125,7 @@ primary_page_banner_centered_with_link_full_width:
centered: true
title: 'EU Budget for the future'
description: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
label: 'Subscribe'
path: 'https://example.com'
assertions:
Expand All @@ -143,7 +143,7 @@ primary_page_banner_centered_with_link_full_width:
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
equals:
'.bcl-banner__content a[href="https://example.com"]': 'Subscribe'
primary_page_banner_aligned_left_without_link:
primary_page_banner_aligned_left_without_call_to_action:
render:
'#type': pattern
'#id': banner
Expand All @@ -169,7 +169,7 @@ primary_page_banner_aligned_left_without_link:
contains:
'.bcl-banner__content div': 'EU Budget for the future'
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
primary_page_hero_banner_aligned_left_without_link_full_width:
primary_page_hero_banner_aligned_left_without_call_to_action_full_width:
render:
'#type': pattern
'#id': banner
Expand All @@ -195,7 +195,7 @@ primary_page_hero_banner_aligned_left_without_link_full_width:
contains:
'.bcl-banner__content div': 'EU Budget for the future'
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
primary_page_hero_banner_centered_with_link:
primary_page_hero_banner_centered_with_call_to_action:
render:
'#type': pattern
'#id': banner
Expand All @@ -208,7 +208,7 @@ primary_page_hero_banner_centered_with_link:
centered: true
title: 'EU Budget for the future'
description: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
label: 'Subscribe'
path: 'https://example.com'
assertions:
Expand All @@ -226,7 +226,7 @@ primary_page_hero_banner_centered_with_link:
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
equals:
'.bcl-banner__content a[href="https://example.com"]': 'Subscribe'
image_page_banner_centered_with_link_full_width:
image_page_banner_centered_with_call_to_action_full_width:
render:
'#type': pattern
'#id': banner
Expand All @@ -239,7 +239,7 @@ image_page_banner_centered_with_link_full_width:
centered: true
title: 'EU Budget for the future'
description: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
label: 'Subscribe'
path: 'https://example.com'
image: 'https://placeimg.com/1000/500/arch'
Expand All @@ -259,7 +259,7 @@ image_page_banner_centered_with_link_full_width:
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
equals:
'.bcl-banner__content a[href="https://example.com"]': 'Subscribe'
image_page_banner_aligned_left_without_link:
image_page_banner_aligned_left_without_call_to_action:
render:
'#type': pattern
'#id': banner
Expand Down Expand Up @@ -287,7 +287,7 @@ image_page_banner_aligned_left_without_link:
contains:
'.bcl-banner__content div': "EU Budget for the future"
'.bcl-banner__content p': "Innovation, economy, environment and geopolitics"
image_page_hero_banner_aligned_left_without_link_full_width:
image_page_hero_banner_aligned_left_without_call_to_action_full_width:
render:
'#type': pattern
'#id': banner
Expand Down Expand Up @@ -315,7 +315,7 @@ image_page_hero_banner_aligned_left_without_link_full_width:
contains:
'.bcl-banner__content div': 'EU Budget for the future'
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
image_page_hero_banner_centered_with_link:
image_page_hero_banner_centered_with_call_to_action:
render:
'#type': pattern
'#id': banner
Expand All @@ -328,7 +328,7 @@ image_page_hero_banner_centered_with_link:
centered: true
title: 'EU Budget for the future'
description: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
label: 'Subscribe'
path: 'https://example.com'
image: 'https://placeimg.com/1000/500/arch'
Expand All @@ -348,7 +348,7 @@ image_page_hero_banner_centered_with_link:
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
equals:
'.bcl-banner__content a[href="https://example.com"]': 'Subscribe'
image_shade_page_banner_centered_with_link_full_width:
image_shade_page_banner_centered_with_call_to_action_full_width:
render:
'#type': pattern
'#id': banner
Expand All @@ -361,7 +361,7 @@ image_shade_page_banner_centered_with_link_full_width:
centered: true
title: 'EU Budget for the future'
description: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
label: 'Subscribe'
path: 'https://example.com'
image: 'https://placeimg.com/1000/500/arch'
Expand All @@ -381,7 +381,7 @@ image_shade_page_banner_centered_with_link_full_width:
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
equals:
'.bcl-banner__content a[href="https://example.com"]': 'Subscribe'
image_shade_page_banner_aligned_left_without_link:
image_shade_page_banner_aligned_left_without_call_to_action:
render:
'#type': pattern
'#id': banner
Expand Down Expand Up @@ -409,7 +409,7 @@ image_shade_page_banner_aligned_left_without_link:
contains:
'.bcl-banner__content div': 'EU Budget for the future'
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
image_shade__hero_banner_aligned_left_without_link_full_width:
image_shade__hero_banner_aligned_left_without_call_to_action_full_width:
render:
'#type': pattern
'#id': banner
Expand Down Expand Up @@ -437,7 +437,7 @@ image_shade__hero_banner_aligned_left_without_link_full_width:
contains:
'.bcl-banner__content div': 'EU Budget for the future'
'.bcl-banner__content p': 'Innovation, economy, environment and geopolitics'
image_shade_hero_banner_centered_with_link:
image_shade_hero_banner_centered_with_call_to_action:
render:
'#type': pattern
'#id': banner
Expand All @@ -450,7 +450,7 @@ image_shade_hero_banner_centered_with_link:
centered: true
title: 'EU Budget for the future'
description: 'Innovation, economy, environment and geopolitics'
link:
call_to_action:
label: 'Subscribe'
path: 'https://example.com'
image: 'https://placeimg.com/1000/500/arch'
Expand Down

0 comments on commit 2412092

Please sign in to comment.