Problem:
When icon is added e.g. before title you sometimes need to align content and vice versa. Block title and content have no shared parent that can be targeted by css to decide if icon is present or not.
Solution:
Add class to div.block
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2032097-4-has_icon_class_for_blocks.patch | 843 bytes | radimklaska |
| #1 | 2032097-1-has_icon_class_for_blocks.patch | 2.2 KB | radimklaska |
Comments
Comment #1
radimklaskaThis patch adds
has-iconclass to every block that has icon set in block settings. It also adds class with icon possition.Comment #2
radimklaskaComment #3
markhalliwellI'm ok with adding
has-iconif you really want it, but the position classes I think are a little unnecessary. In reality, I'd almost say that this should be a "won't fix", try using the Block Class module.Comment #4
radimklaskahas-iconis enough. With other classes: I was just thinking too much ahead and actually ended up not using them.I know about block class module, but i'm using it for "special things" rather than "site admin not breaking stuff when he chooses an icon" :-)
So here is new patch only with
$variables['classes_array'][] = 'has-icon';.Comment #5
markhalliwellAwesome, thanks!
Fixed in commit: 6731d2c.