to be able to integrate the color module in a theme in d7 we need to add the following code to template.php (see here)

/**
 * Override or insert variables into the page template.
 */
function alpha_process_page(&$vars) {
  // Hook into color.module.
  if (module_exists('color')) {
    _color_page_alter($vars);
  }
}
/**
* Override or insert variables into the page template for HTML output.
*/
function alpha_process_html(&$vars) {
  // Hook into color.module.
  if (module_exists('color')) {
    _color_html_alter($vars);
  }
}

adding the code above to "alpha/template.php" cancels the need to edit subtheme template.php

Note: patch generated in 7.x-3.0 version

(in my case I read the doc http://drupal.org/node/108459 , but didn't see the comment about d7, so it took me some time to figure out that I need the code in the comment and get the color module working)

CommentFileSizeAuthor
color_module_easier_integration.patch850 bytesahwebd
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ahwebd’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Status: Active » Needs review
Anticosti’s picture

Subscribing

jdufaur’s picture

Subscribing

Cellar Door’s picture

Assigned: Unassigned » himerus
himerus’s picture

Assigned: himerus » Unassigned
Status: Needs review » Closed (won't fix)

Since Alpha/Omega base theme(s) will never have direct color manipulation except via a subtheme, I feel that this integration is ONLY valid for a subtheme, and should not be a fix against the base theme level.

Any new subtheme, by following docs on integrating color support can do so there, in the subtheme.

Bevan’s picture

Besides that, it doesn't work, because _color_page_alter() doesn't use the Drupal core convention of adding stylesheets with stylesheets[all][] in the theme's info file. (!?)

tierso’s picture

Any new subtheme, by following docs on integrating color support can do so there, in the subtheme.

I've tried googling to little avail, could someone please direct me to the "correct/official" docs on this subject? (I'm using the htm5 starter kit)

Bevan’s picture

tierso: http://drupal.org/node/108459

It is a little out of date for Drupal 7, but still useful. Look at themes/bartik/color/color.inc for an example implementation.

Bevan’s picture

tierso’s picture

Related; #1677540: Support recoloring of stylesheets

Thank you very much for the quick answer. Applied the patch but as I suspected, it will only work for alpha based themes (correct me if I'm wrong). I'll have a go at your other suggestion for now.

Bevan’s picture

I believe omega inherits from alpha, so thus omega sub-themes should work with this too. Note however that this won't magically make a sub-theme recolorable. You still need to add color.inc and various other things into your theme, as per http://drupal.org/node/108459.

Bevan’s picture

Issue summary: View changes

minor