In my role as a web designer at the Idaho Commission for Libraries, I design Drupal themes for our e-Branch in a Box project. On my most recent theme, I wanted to use a gradient background with rounded corners for the block titles. Since we run a multi-site setup, I was a little bit apprehensive to use a jquery solution and ended up using a background image instead. The problem with this technique is that when the block titles are too long, it would wrap around and not align in the image correctly. Since this was a theme for sites that I do not do the day to day maintenance for, I needed a way to catch the titles (the unknown) before they were printed out to the screen and shrink them up a bit. Template.php to the rescue!
Since all blocks are themeable, I went to the Drupal API and looked up the theme_block function. Next, I copied and pasted the function into my Template.php file and made the following modifications:
Continue reading...