theme-settings.php

Same filename in this branch
  1. 9 core/modules/system/tests/themes/test_theme_settings/theme-settings.php
Same filename in other branches
  1. 7.x themes/garland/theme-settings.php
  2. 7.x modules/simpletest/tests/themes/test_theme/theme-settings.php
  3. 8.9.x core/modules/system/tests/themes/test_theme_settings/theme-settings.php
  4. 10 core/themes/olivero/theme-settings.php
  5. 10 core/modules/system/tests/themes/test_theme_settings/theme-settings.php
  6. 11.x core/themes/olivero/theme-settings.php
  7. 11.x core/modules/system/tests/themes/test_theme_settings/theme-settings.php

Functions to support Olivero theme settings.

File

core/themes/olivero/theme-settings.php

View source
<?php


/**
 * @file
 * Functions to support Olivero theme settings.
 */
use Drupal\Core\Form\FormStateInterface;

/**
 * Implements hook_form_FORM_ID_alter() for system_theme_settings.
 */
function olivero_form_system_theme_settings_alter(&$form, FormStateInterface $form_state) {
    $form['olivero_settings']['olivero_utilities'] = [
        '#type' => 'fieldset',
        '#title' => t('Olivero Utilities'),
    ];
    $form['olivero_settings']['olivero_utilities']['mobile_menu_all_widths'] = [
        '#type' => 'checkbox',
        '#title' => t('Enable mobile menu at all widths'),
        '#default_value' => theme_get_setting('mobile_menu_all_widths'),
        '#description' => t('Enables the mobile menu toggle at all widths.'),
    ];
    $form['olivero_settings']['olivero_utilities']['site_branding_bg_color'] = [
        '#type' => 'select',
        '#title' => t('Header site branding background color'),
        '#options' => [
            'default' => t('Primary Branding Color'),
            'gray' => t('Gray'),
            'white' => t('White'),
        ],
        '#default_value' => theme_get_setting('site_branding_bg_color'),
    ];
}

Functions

Title Deprecated Summary
olivero_form_system_theme_settings_alter Implements hook_form_FORM_ID_alter() for system_theme_settings.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.