Support from Acquia helps fund testing for Drupal Acquia logo

Comments

giorgio79’s picture

Version: 8.x-2.x-dev » 7.x-3.x-dev
valkum’s picture

Status: Active » Needs review
FileSize
2.38 KB

Here is a patch.
Should we use other form types than checkboxes for this? Or is the message enough? in terms of static in combination with fixed?

valkum’s picture

The UX namespace in theme settings is not final. I'm not sure whats the best name for this tab is.

markhalliwell’s picture

Status: Needs review » Needs work

Following the example on #2105257: Add theme setting to toggle "well" on regions, I think we should just create a "Navbar" tab.

markhalliwell’s picture

  1. +++ b/bootstrap.info
    @@ -24,6 +24,7 @@ settings[bootstrap_cdn] = 3.0.0
    +settings[bootstrap_navbar_style] = 'fixed-top'
    
    +++ b/theme/settings.inc
    @@ -139,6 +139,27 @@ function _bootstrap_settings_form(&$form, $form_state) {
    +      'static-top' => t('Static Top'),
    +      'fixed-top' => t('Fixed Top'),
    +      'fixed-bottom' => t('Fixed Bottom'),
    

    Shouldn't these three actually be radios, for "position"? The setting name should also probably be bootstrap_navbar_position.

  2. +++ b/theme/settings.inc
    @@ -139,6 +139,27 @@ function _bootstrap_settings_form(&$form, $form_state) {
    +      'inverse' => t('Inverted'),
    

    Just label this as t('Inverse'), like the class. This should probably have it's own setting like, bootstrap_navbar_inverse

  3. +++ b/theme/system/page.vars.php
    @@ -39,4 +39,12 @@ function bootstrap_preprocess_page(&$variables) {
    +  foreach (theme_get_setting('bootstrap_navbar_style') AS $key => $val) {
    

    Lower case "as" inside foreach loops please.

valkum’s picture

Status: Needs work » Needs review
FileSize
3.37 KB
markhalliwell’s picture

Status: Needs review » Needs work
  1. +++ b/bootstrap.info
    @@ -24,6 +24,8 @@ settings[bootstrap_cdn] = 3.0.0
    diff --git a/js/bootstrap.admin.js b/js/bootstrap.admin.js
    index c62d8f1..bdcacbc 100644
    --- a/js/bootstrap.admin.js
    +++ b/js/bootstrap.admin.js
    @@ -41,6 +41,17 @@
             }
             return summary.join(', ');
           });
    +      $('#edit-navbar', context).drupalSetSummary(function(context) {
    +        var summary = [];
    

    I like that you put this in here. Perhaps we could also put some JS to toggle a live preview (if their admin theme is Bootstrap based of course) by adding/removing classes to the navbar when they toggle an option?

  2. +++ b/js/bootstrap.admin.js
    @@ -41,6 +41,17 @@
    +        ¶
    

    Tabbed whitespace.

  3. +++ b/theme/settings.inc
    @@ -144,6 +144,30 @@ function _bootstrap_settings_form(&$form, $form_state) {
    +    '#options' => array(
    +      'static-top' => t('Static Top'),
    +      'fixed-top' => t('Fixed Top'),
    +      'fixed-bottom' => t('Fixed Bottom'),
    +    ),
    

    This is better. Don't we want to provide an empty option, like "Default" or something since these are completely optional? @see https://api.drupal.org/api/drupal/developer%21topics%21forms_api_referen...

  4. +++ b/theme/system/page.vars.php
    @@ -39,4 +39,13 @@ function bootstrap_preprocess_page(&$variables) {
    +  $variables['navbar_classes'] = implode(' ', $variables['navbar_classes_array']);
    

    We probably want to flatten these in bootstrap_process_page() instead (so sub-themes could preprocess the array if needed).

valkum’s picture

Status: Needs work » Needs review
FileSize
4.63 KB
5.69 KB

Status: Needs review » Needs work

The last submitted patch, bootstrap-add-theme-switch-for-navbar-styles-2105819-8.patch, failed testing.

markhalliwell’s picture

Status: Needs work » Needs review
FileSize
6.25 KB

Reroll

markhalliwell’s picture

Status: Needs review » Fixed

Thanks @valkum!

Committed 85498e9 to 7.x-3.x.

valkum’s picture

Version: 7.x-3.x-dev » 7.x-3.0-rc2

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.