camaleon-8.x-1.x-dev/theme-settings.php
theme-settings.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | <?php function camaleon_form_system_theme_settings_alter(& $form , \Drupal\Core\Form\FormStateInterface & $form_state , $form_id = NULL) { // Work-around for a core bug affecting admin themes. See issue #943212. if (isset( $form_id )) { return ; } $form [ 'layout' ] = array ( '#type' => 'details' , '#title' => t( 'Layout settings' ), '#open' => TRUE, ); $form [ 'layout' ][ 'fluid_width' ] = array ( '#type' => 'checkbox' , '#title' => t( 'Fluid width' ), '#default_value' => theme_get_setting( 'fluid_width' ), '#description' => t( "A full container, spanning the entire width of the viewport." ), ); $form [ 'ui' ] = array ( '#type' => 'details' , '#title' => t( 'UI settings' ), '#open' => TRUE, ); $form [ 'ui' ][ 'font_family' ] = array ( '#type' => 'select' , '#title' => t( 'Font family' ), '#options' => [ 'roboto' => t( 'Roboto' ), 'montserrat' => t( 'Montserrat' ), 'nunito' => t( 'Nunito' ), ], '#default_value' => theme_get_setting( 'font_family' ), '#description' => t( "..." ), ); $form [ 'ui' ][ 'font_size' ] = array ( '#type' => 'select' , '#title' => t( 'Font size' ), '#options' => [ '14' => t( '14' ), '16' => t( '16' ), '18' => t( '18' ), ], '#default_value' => theme_get_setting( 'font_size' ), '#description' => t( "..." ), ); $form [ 'front' ] = array ( '#type' => 'details' , '#title' => t( 'Front page settings' ), '#open' => TRUE, ); $form [ 'front' ][ 'hero_enable' ] = array ( '#type' => 'checkbox' , '#title' => t( 'Enable front page hero' ), '#default_value' => theme_get_setting( 'hero_enable' ), '#description' => t( "A big banner in front page." ), ); $form [ 'front' ][ 'hero_title' ] = array ( '#type' => 'textfield' , '#title' => t( 'Text' ), '#default_value' => theme_get_setting( 'hero_title' ), '#description' => t( "A big title." ), ); $form [ 'front' ][ 'hero_text' ] = array ( '#type' => 'textfield' , '#title' => t( 'Text' ), '#default_value' => theme_get_setting( 'hero_text' ), '#description' => t( "A big description." ), ); $form [ 'front' ][ 'hero_link' ] = array ( '#type' => 'url' , '#title' => t( 'Link' ), '#default_value' => theme_get_setting( 'hero_link' ), '#description' => t( "A big link." ), ); } |