I would like to know if it's possible to add a php if statement inside the page.tpl file that will let you use the same .tpl file for both a 2 and 3 column layout, depending on whether you have (for instance) a right block. If a right block is there, then it prints a span-12, if not, then a span-18.

IF
if ($right):
THEN
<div class="col-content span-12"> (a middle column for content in a 3 c layout)
ELSE
<div class="col-content span-18"> (a bigger left column for content in a 2 c layout)

Is this doable?

Thanks.

Comments

drew reece’s picture

The blueprint theme already does this automatically. Take a look inside the template.php the function is phptemplate_preprocess_page().
Editing the 'classes variables' should affect the layout using only one page.tpl. The comments indicate the layout type.

designerbrent’s picture

Status: Active » Patch (to be ported)

That's correct, in the current version, the size only needs to be changed in the template.php file.

designerbrent’s picture

Status: Patch (to be ported) » Fixed

Opps. Wrong status!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.