Posted by lizac on May 30, 2011 at 4:01pm
hi guys.. hope is well.. I just want to ask..
is it safe to remove
<?php
print $classes;
?>
The "class" attribute has an empty or missing attribute value. The expected value is one of the following: an
alphanumeric string or a string.
<div id="block-black_theme_support-8" class=""><div class="block-inner">
PHP code in block.tpl.php
<div id="block-<?php print $block->module . '-' . $block->delta; ?>" class="<?php print $classes; ?> simple_box"><div class="block-inner">
tracing where is the class="', I found it in block.tpl.php with this definition
-
- $classes: A set of CSS classes for the DIV wrapping the block.
Possible values are: block-MODULE, region-odd, region-even, odd, even,
region-count-X, and count-X.
- $classes: A set of CSS classes for the DIV wrapping the block.
so what do you think? As you know... I'm a noob..
Thanks guys!!!
Comments
Not a good idea
Removing the $classes variable doesn't really break your Drupal site but it seriously hampers your efforts to theme. For example: you wanted to do zebra-stripe thing with your blocks - blue backgrounds for odd blocks and green backgrounds for even blocks. How are you supposed write CSS rules for that if you remove the $classes variable from the theme template?
I would rather just leave it on the theme template - it doesn't do anything if there are not CSS rules attached to it but added flexibility when you need it.
Jaypax Ginete
http://killertilapia.blogspot.com/
You are right...
Thanks Jaypax! I just retained $classes