Loving the Block Revisited

blocks

Loving the Block Revisited

A year and a half ago I wrote about How I Learned to Stop Worrying and Love the Block. Since then we've been building all our sites with this philosophy and have evolved it quite a bit.

For those who haven't read previous article yet, basically I laid out the case for using core blocks instead of panels and context. We still found the core block functionality quite primitive and built some modules to help us out. Most notable at the time was the block_visibility module which allowed you to see where a block was visible on the blocks page. No more hunting through each block to see where it was active.

TL;DR - Be sure to check out blocker module below!

Several months later Tom wanted to be able to specify a block on a view instead of a node. There was no good way to do this except with the page path which didn't work in this case. So he created the block_views module which allows you to do just that. Add blocks on specific views.

Another common request we kept getting from clients was to have blocks with images attached. Imagine that! People want images with their text? Unfortunately blocks are really terrible at this. The only way possible was to set up a wysiwyg editor and mice and let them upload the images. This wasn't really what they were looking for as they really wanted a "featured" image that lived outside of the content area of the block. We started using the Bean module. We created a few basic block types with images like a block with an image on the left, a block with a background image and a block with an image above. Then clients could create a block and pick which type of image placement they wanted. The UI is a bit clunky but it works great. There are also other more complex bean types available as modules such as beanslide which is a really easy to configure rotating image block. See Bean Plugins for more.

In the last year, we have started using the bootstrap theme as our base theme and it has some great grid functionality to it. We wanted to be able to easily do grid layouts without crazy complex regions in our themes. We were able to do this with two modules, block_class ad blockgroup. Block class allows an admin to add a class like "col-sm-4" to a block and it will automatically conform to the grid system. Block Group allows an admin to group blocks together and (with the help of a template override) put the blocks in rows. This makes it really easy to have 3 blocks in a row and then 4 below it all in the same region! Oh, and it's responsive.

Finally, our newest and coolest contribution is the blocker module. As we sat down recently and discussed what our clients were having the hardest time with it still was blocks. They just kept asking how to put a block on a page. Even though the blocks system was better than context and panels, it was still counter intuitive to them. So we came up with the blocker module. This module adds a "Manage Blocks" tab on nodes and allows an admin to add blocks for JUST THAT NODE! You can override the title and set block classes (if you have the block_class module). You can even add the block to more than one region and multiple pages. We separated out the functionality from the UI so that the UI can be replaced by something even better in the future but for not our clients are extremely happy with it.

Now I'm curious to hear from all of you and see if you have any tips for making the block system more manageable. See you in the comments!

Photo Credit: http://jeuxsansfrontieres.deviantart.com/art/Wooden-Blocks-Stock-Photo-2...

Related Posts

Holiday Loving at LevelTen!

Erin Tuohy
Read more

Does Mobile Website Design Matter? (Revisited)

Chris Sloan
Read more

Facet Block - The Unknown Hero

Kyle Taylor
Read more

How I Learned to Stop Worrying and Love the Block

Randall Knutson
Read more

How to Programmatically Create a Quicktab Block in Drupal

Dustin Currie
Read more

How to display an RSS feed in a Drupal block

Kristin Brinner
Read more