The 'block' class is getting printed on non-block content.
Specifically in #main-content inside #block-system-main.
If I give the .block class a yellow background color, all blocks get the BG color - (that's fine) but content inside the ID #main-content under #block-system-main also gets the BG color applied although the content is not block-content, but rather teasers or node-lists.
To replicate: simply add the following to your CSS and see the BG color get applied to non-block content (like a list of blog-entry nodes at www.example.com/blogs) in the #main-content:
.block {background-color:#FF0;}
My sense is that the issue is coming from printing the #block-system-main 's .block class.
Although this issue does not occur with other D7 themes, I apologize if this is somehow a result of new theming practice for Drupal7 which I have not yet learned or come-accross.
Hope this helps.
Screenshot attached.
Thanks for all your fantastic work on Omega Jake!
| Comment | File | Size | Author |
|---|---|---|---|
| block-issue-omega-jake-1.jpg | 445.57 KB | chillin |
Comments
Comment #1
himerus commentedJust my first thought here.... BUT....
Since now $content actually IS a block placed by the block manager, it actually IS a block now...
I have yet to play with any CSS specific to the .block class, but I think a new approach would either be to specify for .block-system or #block-system-main CSS that would overwrite any drastic changes that went to .block level CSS...
This may not be 100% correct, but I'm not sure how other themes are avoiding this? I guess it could be possible in preprocess to check for the block id, and if so remove the block class to that section... but I think that may go against the "best practice" in this new situation for blocks.
Thoughts?
Comment #2
himerus commentedMarking this as by design as I think it is simply the "new way" for Drupal content in D7 with the $content region being placed by block management.
Comment #3
Scott J commentedIf anyone does want to remove this .block class from the main content, I found that you can make a copy of block.tpl.php called block--system--main.tpl.php and just remove the outer div from it.
I have also seen this done in template.php file, but right now I can't remember in which theme I saw it.