Making blocks in different rows clear each other (So simple but I cant think how)

Permalink
Hi There,

I am know my HTML and C5, so not a newbie but just a bit stuck by something obvious.

- I have two columns, left and right within my content area
- I have separate content areas in each.
- I want is so a client can add a block to the left column and one to the right, then a new row so they can add a second set of two blocks - in a sort of tabular manner.

The left block is to conatin a youtube embed so I dont really want to do a designer content custom block as that doesnt have a youtube option and I want to keep things flexible.

Its basically a tablular setup but the layouts system doesnt create tables that clear - so if I setup a layout and add blocks of different sizes to two columns, they dont clear one another.

I cant setup the template with a table though because it will just add new content within the same <td> cell?

Any suggestions would be great thanks.

 
JohntheFish replied on at Permalink Reply
JohntheFish
Here is a messy hack idea that would require a theme page type specific to your situation.

In your theme page type, rather than render an entire area, you can get a list of the blocks and then loop through rendering individual blocks.

If you do this for the 2 areas, then you can interleave the 2 area block lists side by side to render the them inside the 2 cols of a table or as 2 floated divs followed by a clearfix, repeating for each pair of blocks.

eg (pseudocode)
$area_L_blocks = get blocks in area for L col;
$area_R_blocks = get blocks in area for R col;
for each $area_L_blocks{
  render an $area_L_block;
  render corresponding $area_R_block;
  clearfix;
}