Closed (fixed)
Project:
NineSixty (960 Grid System)
Version:
6.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2009 at 10:24 UTC
Updated:
5 May 2010 at 21:40 UTC
I've got my main block region which is grid-16. Now I'd like each blocks inside it to automatically receive a grid-3 class. What's the best practice to do so?
Comments
Comment #1
dvessel commentedThe easy way is to create a new template based on "block.tpl.php" named after the region your targeting. Example: block-content.tpl.php. Make sure it lives in the same directory as block.tpl.php within your theme.
From there, simply add the grid class to fit the width.
The harder way is to override the theme function "theme_blocks" (plural) where each block within a region is invoked and keep track how many are being processed for a given region. With that information, you can add dynamic classes to each block instead of a simple "grid-3" which may not always fit.
Comment #2
Kendall Totten commentedOne of the biggest aha moments I've ever experienced was discovering the Block Class module:
http://drupal.org/project/block_class
It was also the missing piece in figuring out how to work with the Zen NineSixty theme. I wrote up a few notes on the working with the grid theme here: http://switchbackcms.com/blog/zen-ninesixty-theme
Hope it helps!
-Kendall
Comment #3
dvessel commentedThanks.