2

I'm using a zen subtheme and I want to display 2 blocks next to each other.

Example

I don't want to create 2 more regions in the info file because it will only be displayed on the home page. (Maybe even 3 blocks on another page)

Trying to move away from panels due to added markup and extra loading times during dev.

Would the correct way be to.

  • Add blocks to content region
  • Add css aka (width:50%) on the blocks to get the desired layout

or Is there another theme layer of some-kind I can use for layouts inside of zen?

2 Answers 2

3

Plain old CSS

Plain old css will work. Set your widths with those two blocks and float them.

Zen Grids

If you create custom classes the zen grid sass extension can be used as well to set up layouts using sass

More on zen grids:

Block class

Block Class is a good way of setting blocks up to line up accordingly next to each other:

Block Class allows users to add classes to any block through the block's configuration interface. By adding a very short snippet of PHP to a theme's block.tpl.php file, classes can be added to the parent element of a block. Hooray for more powerful block theming!

1

You can put both block in same region by setting it to show on front only, as per your requirement. Give 50-50 space to both of them by CSS.

If you need any more class/id to set their display right, you can use a module BLOCK CLASS to set unique ID/class for these or any particular block. Hope it helps :)

2
  • Can Zen Grids sass-extension also work for this situation?
    – sasdev
    Commented Nov 11, 2013 at 17:05
  • I have never worked on Zen, but it should as what I have proposed is Drupal way to handle this..
    – RajeevK
    Commented Nov 11, 2013 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.