Are there any reference to create a 4-column grid? Grid settings for first, middle and last columns?

Comments

danielhonrade’s picture

You can use 12, 16, 24, these are all divisible by 4

1) just edit yourtheme.info, turn on grid
2) edit regions.php, add values to grid for sidebars

coupet’s picture

Yes, but each grid shows up in different rows.
- 4 columns (12) with grids of size 3

Looking for options to show 4 columns grids-3 in one row.

danielhonrade’s picture

for regions, create custom regions in regions.php

like, column1, column2, column3, column4, give each grid => 3 value

then on page.tpl.php, you do like

<div class="wrapper-column">
  <?php print $column1_region; ?>
  <?php print $column2_region; ?>
  <?php print $column3_region; ?>
  <?php print $column4_region; ?>
</div>

you can also do that on blocks in 1 region, have 4 blocks in 1 wide region, just add necessary grid classes.

coupet’s picture

the regions are aligned vertically (top/bottom), not horizontally(left/right) as expected.

firebug shows each region is assigned an id and class

I am trying to create 4 equal columns in one row.

danielhonrade’s picture

is it online? I can only help you further if I can see it.

Btw, did you turn on the grids on yourtheme.info?

coupet’s picture

link sent in contact form

danielhonrade’s picture

Hi,

add clearfix to wrapper:

<div class="wrapper-column clearfix">
        <div class="region region-bottom-first grid-4" id="bottom-first">
        <div class="region region-bottom-second grid-4" id="bottom-second">
        <div class="region region-bottom-third grid-4" id="bottom-third">
</div>

add this to your css:

.wrapper-column .region { float: left; margin: 0 10px; }
.wrapper-column .region-bottom-first { margin-left: 0; }
.wrapper-column .region-bottom-third { margin-right: 0; }
coupet’s picture

works great, but having same issue when creating a row with two columns

danielhonrade’s picture

Hi,

the same thing actually applies, you just have to put on the new regions:

regions.tpl.php, grid = 6

and the css, you just have to rename the classes to the new the regions, but basically same properties, like the float, margins

coupet’s picture

Works perfectly with rows of 2, 3 and 4 columns. I was trying override 24 grid option, but that requires margin adjustments.

danielhonrade’s picture

on 24, the margins would be just 5px instead of 10px

danielhonrade’s picture

Status: Active » Closed (fixed)