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

added formatted text body field to paragraph vertical tab and fixed s… #931

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from
Open
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: 8 additions & 0 deletions scss/illinois-framework/_paragraphs.vertical-tab.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.paragraph--type--vertical-tab {
.fixed-width {
padding: 0;
}
.field--name-field-vertical-tab-panel-body-fo {
padding-top: 1rem;
}
}
1 change: 1 addition & 0 deletions scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
@import "illinois-framework/paragraphs.hero--section";
@import "illinois-framework/paragraphs.accordion";
@import "illinois-framework/paragraphs.image-gallery";
@import "illinois-framework/paragraphs.vertical-tab";

// Views
@import "illinois-framework/view.frontpage";
Expand Down
5 changes: 4 additions & 1 deletion templates/paragraphs/paragraph--vertical-tab-panel.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@
{% block content %}
<il-vertical-tab-panel id="il-vertical-tab-id-">
<h3 slot="header">{{ content.field_vertical_tab_panel_title }}</h3>
<div class="field--name-field-vertical-tab-panel__body">{{ content.field_vertical_tab_panel_body }}</div>
{% if content.field_vertical_tab_panel_body['#items'] %}
<div class="field--name-field-vertical-tab-panel__body">{{ content.field_vertical_tab_panel_body }}</div>{# this body field is deprecated #}
{% endif %}
<div class="field--name-field-vertical-tab-panel__body__fo">{{ content.field_vertical_tab_panel_body_fo }}</div>
</il-vertical-tab-panel>

{% endblock %}
Expand Down
20 changes: 15 additions & 5 deletions templates/paragraphs/paragraph--vertical-tab.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,33 @@
* @ingroup themeable
*/
#}
{% if content.field_vertical_tab_background['#items'].0.value == 'il-theme-gray' %}
{% set background = 'background--color--gray' %}
{% elseif content.field_vertical_tab_background['#items'].0.value == 'il-theme-blue' %}
{% set background = 'background--color--illiniblue' %}
{% else %}
{% set background = 'background--color--white' %}
{% endif %}
{%
set classes = [
'paragraph',
'paragraph--type--' ~ paragraph.bundle|clean_class,
view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class,
not paragraph.isPublished() ? 'paragraph--unpublished',
'col-lg-12 col-md-12 col-sm-12 full-width il-formatted' ~ flex_row_class ~ max_width
'col-lg-12 col-md-12 col-sm-12 full-width il-formatted ' ~ flex_row_class ~ max_width ~ background
]
%}
{% block paragraph %}
{# Paragraph ID used for anchor linking #}
<div {{ attributes.setAttribute('id', 'paragraph--' ~ paragraph.id() ) }} {{ attributes.addClass(classes) }}>
{% block content %}
<il-vertical-tab class="{{ content.field_vertical_tab_background['#items'].0.value }}">
<h2 slot="title">{{ content.field_vertical_tab_title }}</h2>
{{ content.field_vertical_tab }}
</il-vertical-tab>
<div class="fixed-width">
<il-vertical-tab class="{{ content.field_vertical_tab_background['#items'].0.value }}">
<h2 slot="title">{{ content.field_vertical_tab_title }}</h2>
{{ content.field_vertical_tab }}
</il-vertical-tab>
</div>


{% endblock %}
</div>
Expand Down