Closed (won't fix)
Project:
Omega
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2011 at 22:16 UTC
Updated:
12 Jul 2012 at 03:13 UTC
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)
| Comment | File | Size | Author |
|---|---|---|---|
| color_module_easier_integration.patch | 850 bytes | ahwebd |
Comments
Comment #1
ahwebd commentedComment #2
Anticosti commentedSubscribing
Comment #3
jdufaur commentedSubscribing
Comment #4
cellar door commentedComment #5
himerus commentedSince 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.
Comment #6
Bevan commentedBesides that, it doesn't work, because
_color_page_alter()doesn't use the Drupal core convention of adding stylesheets withstylesheets[all][]in the theme's info file. (!?)Comment #7
tierso commentedI'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)
Comment #8
Bevan commentedtierso: http://drupal.org/node/108459
It is a little out of date for Drupal 7, but still useful. Look at
themes/bartik/color/color.incfor an example implementation.Comment #9
Bevan commentedRelated; #1677540: Support recoloring of stylesheets
Comment #10
tierso commentedThank 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.
Comment #11
Bevan commentedI 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.
Comment #11.0
Bevan commentedminor