Closed (fixed)
Project:
Zen
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 May 2008 at 11:45 UTC
Updated:
28 Sep 2008 at 12:52 UTC
In my sub theme I have the block editing setting enabled and I've added a call to block-editing.css from my subtheme.info file, however both themes (parent and sub theme) are adding block-editing.css.
Eg:
<head>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/subtheme/block-editing.css" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/block-editing.css" />
</head>
I've cleared the cache which didn't have any effect. Other stylesheets are overridden as expected.
I have a feeling it's related to this function on line 109 of template.php:
<?php
// Optionally add the block editing styles.
if (theme_get_setting('zen_block_editing')) {
drupal_add_css(path_to_zentheme() . '/block-editing.css', 'theme', 'all');
}
?>
I'm not sure of the solution.
Comments
Comment #1
dasithds commentedIm not sure but try disabling the zen theme and just use the subtheme....
lets see what happens...
Dasith.
Comment #2
Rowanw commentedThe sub theme is the only one enabled at this point.
Comment #3
dasithds commentedDid you develop the subtheme upon the zen theme and just change the name?
Comment #4
Rowanw commentedI followed the instructions in the readme and moved the SUBTHEME folder out of zen, then changed all the occurrences of 'SUBTHEME' to the name of my theme. Is that what you're referring to?
Comment #5
johnalbinThe styles in block-editing.css are pretty basic (by design). If you need to override them, your best bet is to provide more specific rules in your mytheme.css file.
Then it doesn't matter that block-editing.css is loaded after mytheme.css. The order of loading only matters if the styles have the same specificity. http://www.w3.org/TR/CSS21/cascade.html
Is this enough info to help you out?
Comment #6
Rowanw commentedThat's not going to take away the extra stylesheet. ;)
Comment #7
Rowanw commentedA less-dirty workaround is to copy zen_preprocess_block() to the subtheme's template.php and then disable the block-editing setting in the theme settings.
Comment #8
johnalbinBTW, this issue is complicated by a bug in Drupal core: http://drupal.org/node/197124
Have you tried this? I don't think it will work because if you copy zen_preprocess_block into your subtheme's subtheme_preprocess_block, the version in the main Zen theme will still get called.
Instead of conditionally including this CSS, perhaps Zen should always include the file (from inside the .info file.) If Zen did it that way you could override the block-editing.css the normal way from your subtheme's .info file.
Comment #9
Rowanw commentedWhen I copied
zen_preprocess_block()I obviously had to change the name of the function and remove the condition that checks if the setting is enabled. It seems to work fine for now, I even modified it to work with the edit link for Views 2.The current behaviour for loading block-editing.css is good so I'd like to see it stay if possible, but if there's no solution in sight then it's probably better to load the stylesheet from zen.info, as you suggested.
Comment #10
johnalbin#197124: Unable to ignore module’s and base theme’s stylesheets has been fixed!
So I'll work on getting a fix for this into Zen this week.
Comment #11
johnalbinblock-editing.css has been updated. And its now listed in the .info files for easy overriding.
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.