Option to select logo
shadyman@errora... - September 14, 2007 - 07:44
| Project: | Multiple Domains |
| Version: | 5.x-1.x-dev |
| Component: | code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
Hi, it would be great to be able to choose a logo for each domain without having multiple versions of each theme.
--Shadyman

#1
Quick Fix/Temporary Fix:
Have a different theme or copy of a theme as default for each site, use a different logo that way.
#2
I also really want this option. I have been planning on using the multiple theme hack but this would be a great feature.
I have been trying to hack the module to add this feature but can't figure out how to get the new setting to save. I was able to get the new field to show using the following code, I just want it to save now.
Ok, that was dumb, I got it to save, here is the modified code:
in the file:
modules/multidomain/multidomain.module
$form['variables']['theme_default'] = array(
'#type' => 'select',
'#title' => t('Default theme'),
'#options' => $options,
'#default_value' => variable_get('theme_default', 'garland'),
);
+ $form['logo_path'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Header Image'),
+ '#description' => t('The optional path to a header image to override the theme custom.'),
+ '#size' => 40,
+ '#maxlength' => 255,
+ '#default_value' => $edit['logo_path'],
+ );
I am having trouble getting it to actually show up though.
< a day goes by >
Ah I finally got it, unfortunately it requires a hack to the theme system so I am sure there is a better method of doing it, but it does work and overrides the themes custom logo (doesn't override if the default logo is selected). Here is the rest of the hack to add to the modifications above:
in the file:
modules/multidomain/multidomain.module
In the function:
function multidomain_init() {
// Set any variables specific to this domain.
if(isset($domain['variables']) && is_array($domain['variables'])) {
foreach($domain['variables'] as $name => $value) {
$conf[$name] = $value;
}
}
+ $conf['logo_path'] = $domain['logo_path'];
----------------------------------------------
Then in the file:
includes/theme.inc
in the function:
function theme_get_setting($setting_name, $refresh = FALSE) {
global $theme_key;
static $settings;
+global $conf;
...
if ($settings['toggle_logo']) {
if ($settings['default_logo']) {
$settings['logo'] = base_path() . dirname($theme_object->filename) .'/logo.png';
}
+ elseif ($conf['logo_path']) {
+ $settings['logo'] = base_path() . $conf['logo_path'];
+ }
There's no upload feature which could be nice, but hey, it works.
#3
#4
#5
Hmm. The main problem with this patch is that we can't change multidomain for everyone unless we can either:
a) get the themes module changed, or
b) Provide a patch like we do for the drupal core
I'm against option b, because there are going to be a lot of people who aren't going to care about this functionality who may then be applying the patch, etc.
My suggestion is that you use a theme like chameleon, and modify that slightly.