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

Updates sidebar regions #650

Merged
merged 1 commit into from
Feb 6, 2024
Merged
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
4 changes: 1 addition & 3 deletions boulder_base.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ regions:
breadcrumb: "Breadcrumb Navigation"
post_wide_title: "Post Wide Title"
above_content: "Above Content"
left_sidebar: "Sidebar First"
content: "Content"
right_sidebar: "Sidebar Second"
sidebar: "Sidebar"
wide_post: "Wide Post"
below_content: "After Content"
second_below_content: "After Content 2"
social: "Social Media Menu"
footer: "Footer"
site_information: 'Site Information'
footer_menu: 'Footer Menu'

1 change: 1 addition & 0 deletions boulder_base.theme
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function boulder_base_preprocess_page(array &$variables) {
$variables['ucb_header_color'] = $headerColor = theme_get_setting('ucb_header_color');
$variables['ucb_be_boulder'] = theme_get_setting('ucb_be_boulder');
$variables['ucb_social_share_position'] = theme_get_setting('ucb_social_share_position');
$variables['ucb_sidebar_position'] = theme_get_setting('ucb_sidebar_position');
$variables['ucb_rave_alerts'] = theme_get_setting('ucb_rave_alerts');
$variables['ucb_sticky_menu'] = theme_get_setting('ucb_sticky_menu');
$variables['ucb_heading_font'] = theme_get_setting('ucb_heading_font');
Expand Down
2 changes: 1 addition & 1 deletion config/install/boulder_base.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ favicon:
mimetype: image/png
ucb_campus_header_color: '1'
ucb_header_color: '3'
ucb_sidebar_position: '0'
ucb_sidebar_position: right
ucb_be_boulder: '1'
ucb_rave_alerts: 1
ucb_sticky_menu: 0
Expand Down
24 changes: 5 additions & 19 deletions templates/layout/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -177,40 +177,26 @@
</div>
{% endif %}
{# We are checking for length below to make sure that the sidebars have any content. This is so that sidebar menus don't render the sidebars if the menu is empty #}
{% if (page.left_sidebar|render|striptags|trim|length > 0) or (page.right_sidebar|render|striptags|trim|length > 0) %}
{% if page.left_sidebar|render and page.right_sidebar|render %}
{% if page.sidebar|render|striptags|trim|length > 0 %}
{% if ucb_sidebar_position == 'left' %}
<div class="ucb-layout-container container g-0">
<div class="layout-row row">
<div class="ucb-left-sidebar ucb-sidebar col-sm-12 col-md-4 col-lg-3">
{{ page.left_sidebar }}
</div>
<div class="ucb-layout-main col-sm-12 col-md-4 col-lg-6 ucb-has-sidebar">
{{ page.content }}
</div>
<div class="ucb-left-right ucb-sidebar col-sm-12 col-md-4 col-lg-3">
{{ page.right_sidebar }}
</div>
</div>
</div>
{% elseif page.left_sidebar|render %}
<div class="ucb-layout-container container g-0">
<div class="layout-row row">
<div class="ucb-left-sidebar ucb-sidebar col-sm-12 col-md-4 col-lg-3">
{{ page.left_sidebar }}
{{ page.sidebar }}
</div>
<div class="ucb-layout-main col-sm-12 col-md-8 col-lg-9 ucb-has-sidebar">
{{ page.content }}
</div>
</div>
</div>
{% elseif page.right_sidebar|render %}
{% else %}
<div class="ucb-layout-container container g-0">
<div class="layout-row row">
<div class="ucb-layout-main col-sm-12 col-md-8 col-lg-9 ucb-has-sidebar">
{{ page.content }}
</div>
<div class="ucb-left-right ucb-sidebar col-sm-12 col-md-4 col-lg-3">
{{ page.right_sidebar }}
{{ page.sidebar }}
</div>
</div>
</div>
Expand Down
Loading