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

Homepage updates #1456

Merged
merged 5 commits into from
Nov 12, 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: 4 additions & 0 deletions boulder_base.theme
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,17 @@ function boulder_base_preprocess_page(array &$variables) {
$variables['ucb_footer_menu_default_links'] = theme_get_setting('ucb_footer_menu_default_links');
$variables['show_breadcrumb'] = theme_get_setting('ucb_breadcrumb_nav');
$variables['theme_path'] = base_path() . $variables['directory'];
$variables['ucb_homepage_header'] = theme_get_setting('ucb_homepage_header');
$variables['ucb_campus_header_color'] = theme_get_setting('ucb_campus_header_color');
$variables['ucb_header_color'] = $headerColor = theme_get_setting('ucb_header_color');
$variables['ucb_be_boulder'] = theme_get_setting('ucb_be_boulder');
$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');
$variables['ucb_above_content_region_color'] = theme_get_setting('ucb_above_content_region_color');
$variables['ucb_after_content_one_region_color'] = theme_get_setting('ucb_after_content_one_region_color');
$variables['ucb_after_content_two_region_color'] = theme_get_setting('ucb_after_content_two_region_color');
$useCustomLogo = theme_get_setting('ucb_use_custom_logo');
if ($useCustomLogo) {
$fileUrlGenerator = \Drupal::service('file_url_generator');
Expand Down
4 changes: 4 additions & 0 deletions config/install/boulder_base.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ favicon:
use_default: 0
path: /themes/custom/boulder_base/favicon.png
mimetype: image/png
ucb_homepage_header: 0
ucb_campus_header_color: '1'
ucb_header_color: '3'
ucb_sidebar_position: right
Expand All @@ -22,4 +23,7 @@ ucb_footer_menu_default_links: 0
ucb_breadcrumb_nav: 1
ucb_use_custom_logo: false
ucb_heading_font: 'bold'
ucb_above_content_region_color: 'white'
ucb_after_content_one_region_color: 'white'
ucb_after_content_two_region_color: 'white'
web_express_version: '20241030'
2 changes: 1 addition & 1 deletion css/layout-builder-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
padding-bottom: 0;
}

.ucb-bootstrap-layout-section .column .block:last-child, .ucb-sidebar .block:last-child, .ucb-above-content-region .block:last-child, .ucb-below-content-region .block:last-child {
.ucb-bootstrap-layout-section .column .block:last-child, .ucb-sidebar .block:last-child{
margin-bottom: 0
}

Expand Down
4 changes: 4 additions & 0 deletions css/ucb-brand-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
.ucb-brand-bar img.ucb-logo {
max-width: 240px;
}

.ucb-brand-bar img.ucb-logo.ucb-homepage {
max-width: 320px;
}
}

.ucb-brand-bar .ucb-brand-bar-controls {
Expand Down
80 changes: 48 additions & 32 deletions templates/layout/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@
{% set header_color = 'dark' %}
{% endif %}

{% if ucb_homepage_header %}
{% set hompeage_logo_size = "ucb-homepage" %}
{% else %}
{% set hompeage_logo_size = "" %}
{% endif %}

{% if ucb_rave_alerts %}
<rave-alert feed="https://www.getrave.com/rss/cuboulder/channel1" link="https://alerts.colorado.edu"></rave-alert>
{% endif %}
Expand All @@ -116,7 +122,7 @@
<div class="container">{{ attach_library('boulder_base/ucb-brand-bar') }}
<div class="ucb-brand-bar ucb-brand-bar-{{ campus_header_color }}">
<a href="https://www.colorado.edu" class="ucb-home-link">
<img class="ucb-logo" src="https://cdn.colorado.edu/static/brand-assets/live/images/cu-boulder-logo-text-{{ campus_header_text_color }}.svg" alt="University of Colorado Boulder">
<img class="ucb-logo {{ hompeage_logo_size }}" src="https://cdn.colorado.edu/static/brand-assets/live/images/cu-boulder-logo-text-{{ campus_header_text_color }}.svg" alt="University of Colorado Boulder">
</a>
<div class="ucb-brand-bar-controls">
{# Google Translate #}
Expand Down Expand Up @@ -157,33 +163,35 @@
{% if site_search.0 %}
{% include '@boulder_base/includes/ucb-search-modal.html.twig' %}
{% endif %}
<header class="ucb {{ header_color }}{% if site_affiliation.id %} ucb-site-affiliation-{{ site_affiliation.id }}{% endif %}" role="banner">
<div class="container ucb-menu-wrapper">
<div class="ucb-site-name-wrapper">
<a href="{{ front_page }}">
{% if ucb_custom_logo %}<img role="img" class="ucb-custom-logo" srcset="{{ ucb_custom_logo.url }} {{ ucb_custom_logo.scale }}" alt="{{ site_name }}">
{% else %}
{{ site_name }}
{% endif %}
</a>
{% if site_affiliation.id %}
<div class="affiliation">
{% if site_affiliation.url %}
<a href="{{ site_affiliation.url }}">{{ site_affiliation.label }}</a>
{% if not ucb_homepage_header %}
<header class="ucb {{ header_color }}{% if site_affiliation.id %} ucb-site-affiliation-{{ site_affiliation.id }}{% endif %}" role="banner">
<div class="container ucb-menu-wrapper">
<div class="ucb-site-name-wrapper">
<a href="{{ front_page }}">
{% if ucb_custom_logo %}<img role="img" class="ucb-custom-logo" srcset="{{ ucb_custom_logo.url }} {{ ucb_custom_logo.scale }}" alt="{{ site_name }}">
{% else %}
{{ site_affiliation.label }}
{{ site_name }}
{% endif %}
</div>
</a>
{% if site_affiliation.id %}
<div class="affiliation">
{% if site_affiliation.url %}
<a href="{{ site_affiliation.url }}">{{ site_affiliation.label }}</a>
{% else %}
{{ site_affiliation.label }}
{% endif %}
</div>
{% endif %}
</div>
{% if (page.primary_menu|render and drupal_menu('main')|render) or (page.secondary_menu|render and (drupal_menu('secondary')|render or drupal_menu('social-media-menu')|render)) or (page.footer_menu|render and (drupal_menu('footer')|render or drupal_menu('social-media-menu')|render)) %}
<button id="ucb-mobile-menu-toggle" aria-label="Toggle menu">
<i class="ucb-mobile-menu-open-icon fa-solid fa-bars"></i>
<i class="ucb-mobile-menu-close-icon fa-solid fa-xmark"></i>
</button>
{% endif %}
</div>
{% if (page.primary_menu|render and drupal_menu('main')|render) or (page.secondary_menu|render and (drupal_menu('secondary')|render or drupal_menu('social-media-menu')|render)) or (page.footer_menu|render and (drupal_menu('footer')|render or drupal_menu('social-media-menu')|render)) %}
<button id="ucb-mobile-menu-toggle" aria-label="Toggle menu">
<i class="ucb-mobile-menu-open-icon fa-solid fa-bars"></i>
<i class="ucb-mobile-menu-close-icon fa-solid fa-xmark"></i>
</button>
{% endif %}
</div>
</header>
</header>
{% endif %}
<section class="ucb-main-nav-section mobile ucb-header-{{ header_color }}" role="navigation">
<div class="ucb-main-nav-container ucb-secondary-menu-position-{{ ucb_secondary_menu_position == 'above' ? 'above' : 'inline container' }} ucb-button-{{ menu_button_color }}">
{{ page.primary_menu }}
Expand Down Expand Up @@ -228,9 +236,11 @@
</div>
{% endif %}
{% if page.above_content|render %}
<div class="ucb-above-content-region ucb-layout-container container ucb-contained-row">
<div class="layout-row row">
{{ page.above_content }}
<div class="ucb-above-content-region ucb-bootstrap-layout__background-color--{{ucb_above_content_region_color}}">
<div class="ucb-layout-container container ucb-contained-row">
<div class="layout-row row">
{{ page.above_content }}
</div>
</div>
</div>
{% endif %}
Expand Down Expand Up @@ -273,15 +283,21 @@
</div>
{% endif %}
{% if page.below_content|render %}
<div class="ucb-below-content-region ucb-layout-container container ucb-contained-row">
<div class="layout-row row">
{{ page.below_content }}
<div class="ucb-below-content-region ucb-bootstrap-layout__background-color--{{ ucb_after_content_one_region_color }}">
<div class="ucb-layout-container container ucb-contained-row">
<div class="layout-row row">
{{ page.below_content }}
</div>
</div>
</div>
{% endif %}
{% if page.second_below_content|render %}
<div class="ucb-below-content-region ucb-layout-container container ucb-contained-row">
{{ page.second_below_content }}
<div class="ucb-below-content-region ucb-bootstrap-layout__background-color--{{ ucb_after_content_two_region_color }}">
<div class="ucb-layout-container container ucb-contained-row">
<div class="layout-row row">
{{ page.second_below_content }}
</div>
</div>
</div>
{% endif %}
</div>
Expand Down
17 changes: 17 additions & 0 deletions templates/regions/region--site-information.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@
<p class = "ucb-site-information-print">© Regents of the University of Colorado</p>
</div>
</div>
{% elseif ucb_be_boulder == '3' %}
<div class="be-boulder-container text-center">
<div class="ucb-footer" style="width: 100%;">
<p><a href="https://www.colorado.edu"><img alt="Be Boulder." class="ucb-footer-be-boulder" src="https://cdn.colorado.edu/static/brand-assets/live/images/be-boulder-white.svg" style="max-width:320px; height:auto;"></a></p>
{{ content }}
<p><a class="ucb-home-link" href="https://www.colorado.edu">University of Colorado Boulder</a></p>
<p>&copy; Regents of the University of Colorado</p>
<p class="ucb-info-footer-links"><a href="https://www.colorado.edu/compliance/policies/privacy-statement">Privacy</a> &bull; <a href="https://www.colorado.edu/about/legal-trademarks">Legal &amp; Trademarks</a> &bull; <a href="https://www.colorado.edu/map">Campus Map</a></p>
<p class="ucb-info-footer-links mb-3"><a href="https://www.colorado.edu/accessibility" class="">Accessibility</a>&nbsp;•&nbsp;<a href="https://www.colorado.edu/about/your-right-know">Student Consumer Information</a>&nbsp;• <a href="https://www.colorado.edu/land-acknowledgment">Land Acknowledgement</a> •&nbsp;<a href="https://www.colorado.edu/policies">Policies</a>&nbsp;• <a href="https://www.colorado.edu/jobs">CU Boulder Jobs</a></p>
<p>Download the&nbsp;<strong><a href="https://www.colorado.edu/node/5273/attachment">Clery Act Annual Security &amp;&nbsp;Fire safety report</a></strong>,&nbsp;or&nbsp;<strong><a href="https://www.colorado.edu/police/clery">request a paper&nbsp;copy</a></strong>&nbsp;from&nbsp;the CU&nbsp;Boulder&nbsp;<strong><a href="https://www.colorado.edu/police/">Police Department</a></strong>. &nbsp;</p>
</div>
</div>
<div class="ucb-footer-print">
<p><a class="ucb-home-link ucb-site-information-print-title" href="https://www.colorado.edu">University of Colorado Boulder</a></p>
<p class = "ucb-site-information-print">© Regents of the University of Colorado</p>
</div>
</div>
{% else %}
{{ content }}
{% endif %}
Expand Down