Hi! I created a patch for 7.x-3.4 to allow to users to set theme-color tag (https://developers.google.com/web/updates/2014/11/Support-for-theme-colo...) for Chrome Android 39+ in theme settings.

Theme settings
Only local images are allowed.

will be possible to do a pull request for include this feature in next release? Thanks!!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sergiocarracedo created an issue. See original summary.

markhalliwell’s picture

Status: Active » Needs work
Issue tags: -android, -theme-color
  1. +++ b/templates/system/html.vars.php
    @@ -57,6 +57,21 @@ function bootstrap_preprocess_html(&$variables) {
    +  //Chrome Android Theme color meta
    
    +++ b/theme-settings.php
    @@ -226,6 +226,23 @@ function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_i
    +  //Theme color
    

    Missing space and punctuation ending.

  2. +++ b/templates/system/html.vars.php
    @@ -57,6 +57,21 @@ function bootstrap_preprocess_html(&$variables) {
    +  $theme_color = bootstrap_setting('theme_color');
    
    +++ b/theme-settings.php
    @@ -226,6 +226,23 @@ function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_i
    +  $form['general']['theme']['bootstrap_theme_color'] = array(
    ...
    +    '#default_value' => bootstrap_setting('theme_color', $theme),
    

    The setting name should reflect what this is, e.g. "meta_theme_color".

  3. +++ b/theme-settings.php
    @@ -226,6 +226,23 @@ function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_i
    +  $form['general']['theme'] = array(
    

    I'm not sure about adding a whole new fieldset for this.

  4. +++ b/theme-settings.php
    @@ -226,6 +226,23 @@ function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_i
    +    '#title' => t('Chrome Android Theme color'),
    

    This should reflect the property name, e.g. "Meta: Theme Color".

  5. +++ b/theme-settings.php
    @@ -226,6 +226,23 @@ function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_i
    +    '#description' => t('Use <code>#rrbbgg

    for colorize status bar un Chrome Android. See Theme Color', array(
    + '!url' => 'hhttps://developers.google.com/web/updates/2014/11/Support-for-theme-colo...',

    "Provide a color hex value. This meta tag is used by Chrome on mobile devices to colorize the native UI tool/status bars. See this announcement for more details."

---

Generally speaking, I would say that this should be left for a sub-theme to implement as it's so esoteric in nature. I would also say that we shouldn't mention "Chrome" or "Android" specifically since I can also see the potential for this to eventually becoming adopted by other browsers/devices.

I still have to think about whether it's a good idea to implement this since I can see many people thinking that this would "theme" their actual site to this color (i.e. it's an unfortunate coincidence/property name).

markhalliwell’s picture

Version: 7.x-3.4 » 8.x-3.x-dev
Assigned: sergiocarracedo » Unassigned
Issue tags: +Needs backport to D7

Also, 8.x-3.x is now HEAD... it will need to be implemented there first and then backported to 7.x-3.x.

sergiocarracedo’s picture

Thanks for the quick reply. Ok, I try to implement same patch in 8.x-3.x. I will send patch when it's will be ready

sergiocarracedo’s picture

FileSize
1.96 KB

I created a patch for 8-x.3-x. I changed fieldgroup title from 'Theme' to 'Metas' to avoid confusion width theme
I know that this funcionality could get using metatag module and config a custon metatag, but i think is easier for users config the color in theme (or subtheme)

Thanks!

neardark’s picture

Status: Needs work » Closed (won't fix)

I tend to agree, I'm not sure this should be a setting in the Drupal Bootstrap subtheme. If we get a lot of requests for this, we'll consider adding.

markhalliwell’s picture

Status: Closed (won't fix) » Postponed

I'd rather postpone this and see if it gets any more traction before out right refusing to add it. I'd hate to see the work @sergiocarracedo has done (for both branches btw) go unappreciated.

nikathone’s picture

FYI, the https://www.drupal.org/project/metatag module(D7 at least) allow you to add this through the UI

markhalliwell’s picture

Status: Postponed » Closed (won't fix)

Hm. Good point!

I'm really sorry @sergiocarracedo :( I just don't think this is going to happen after all.

sergiocarracedo’s picture

No problem. I moved this feature to my own subtheme. Thanks for your time!