hook_form_system_theme_settings_alter

function hook_form_system_theme_settings_alter

hook_form_system_theme_settings_alter(&$form, &$form_state)

Allow themes to alter the theme-specific settings form.

With this hook, themes can alter the theme-specific settings form in any way allowable by Drupal's Form API, such as adding form elements, changing default values and removing form elements. See the Form API documentation on api.drupal.org for detailed information.

Note that the base theme's form alterations will be run before any sub-theme alterations.

Parameters

$form: Nested array of form elements that comprise the form.

$form_state: A keyed array containing the current state of the form.

File

modules/system/theme.api.php, line 87

Code

function hook_form_system_theme_settings_alter(&$form, &$form_state) {
  // Add a checkbox to toggle the breadcrumb trail.
  $form['toggle_breadcrumb'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display the breadcrumb'),
    '#default_value' => theme_get_setting('toggle_breadcrumb'),
    '#description' => t('Show a trail of links from the homepage to the current page.'),
  );
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!theme.api.php/function/hook_form_system_theme_settings_alter/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部