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

SDSS-1007: Add support for global footer variant. #724

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ favicon:
logo:
use_default: true
brand_bar_variant: default
global_footer_variant: default
lockup:
option: a
line1: Jumpstart
Expand Down
5 changes: 5 additions & 0 deletions themes/stanford_basic/stanford_basic.theme
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ function stanford_basic_preprocess_page(&$vars) {
if ($bbv !== "none") {
$vars['brand_bar_variant'] = 'su-brand-bar--' . $bbv;
}
// Variant setting for the global footer.
$global_footer_variant = theme_get_setting('global_footer_variant');
if ($global_footer_variant !== "none") {
$vars['global_footer_variant'] = 'su-global-footer--' . $global_footer_variant;
}
joegl marked this conversation as resolved.
Show resolved Hide resolved

// Prepares non node/panel pages to be in a single column.
_stanford_basic_preprocess_not_nodes($vars);
Expand Down
4 changes: 2 additions & 2 deletions themes/stanford_basic/templates/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
{%- block block_help -%}
{{ page.help }}
{%- endblock -%}

<section>
{{ page.header }}
{{ page.search }}
Expand All @@ -65,7 +65,7 @@
{%- block block_footer -%}
<footer id="footer">
{{ page.footer }}
{%- include template_global_footer -%}
{%- include template_global_footer with { modifier_class : global_footer_variant } -%}
</footer>
{%- endblock -%}

Expand Down
16 changes: 16 additions & 0 deletions themes/stanford_basic/theme-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ function stanford_basic_form_system_theme_settings_alter(array &$form, FormState
'#default_value' => theme_get_setting('brand_bar_variant'),
];

// Global footer support.
$form['options_settings']['stanford_basic_global_footer'] = [
'#type' => 'fieldset',
'#title' => t('Global Footer Settings'),
];

$form['options_settings']['stanford_basic_global_footer']['global_footer_variant'] = [
'#type' => 'select',
'#title' => t('Global Footer Variant'),
'#options' => [
'default' => '- Default -',
'dark' => t('Dark'),
],
joegl marked this conversation as resolved.
Show resolved Hide resolved
'#default_value' => theme_get_setting('global_footer_variant'),
];

$img = '<img src="' . base_path() . \Drupal::service('extension.list.theme')
->getPath('stanford_basic') . '/dist/assets/img/lockup-example.png" />';
$decanter = Link::fromTextAndUrl('Decanter Lockup Component', Url::fromUri('https://decanter.stanford.edu/component/identity-lockup/'))
Expand Down
Loading