#149 Problem with column autodetect

FOL
closed
nobody
index (20)
5
2003-03-02
2002-04-16
No

(Not sure what FOL stands for...)

Most modules now use a bit of code to work out which of
four templates to use when displaying the page. The
current code has a typo which means that the default is
to shove the main block into a narrow righthand column.

The fixed fragment is as follows:

if (empty($leftblocks)) {
if (empty($rightblocks)) {
$rightblocks = $block->getBlocks($ary);
$tplfile = 'index2colleft.tpl';
// did say 'right' ^^^^
// better, but non-backward compatible: 'index1col.tpl'
} else {
$tplfile = 'index2colright.tpl';
}
} elseif (empty($rightblocks)) {
$tplfile = "index2colleft.tpl";
} else {
$tplfile = "index3col.tpl";
}

Peter

Discussion

  • Logged In: YES
    user_id=279604

    Seems tio have gone away, if it ever existed :-)

    It would be cool if we could move this repeated bit of code
    to either a Back-End-style generatePage() function, or a
    slashBody(). That way, treatment of columns can be kept
    consistent, making it easier to patch, for instance to deal
    with unspecified or unexpected column names.

     
    • status: open --> closed