Question
I am looking for a simple and effective way to implement template for specific block IDs.
From what I read in Author information lost after saving node and Drupal 6 Template Suggestions, I came up with the following code, which doesn't seem to work:
function mytheme_preprocess_block(&$vars) {
array_unshift($vars['template_files'], 'block-' . $vars['region'] . '-' . filter_xss($vars['id']));
}
From the Drupal documentation it should block-module-delta.tpl.php.
- Delta is the block ID, that's ok
- Module? What's the module here it's a custom block created by adding a block.
Solution
Use Firebug to inspect the generated HTML to get the block name|module !
OTHER TIPS
Have you checked out the skinr module? http://drupal.org/project/skinr
http://www.youtube.com/watch?v=NRsbVguQ7b4
You can add classes to particular blocks and reuse styles. This can be very helpful if you're using a grid system or any of the grid themes.
Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange