I need some help tweeking the code below. I am trying to use the code with Joomla 1.5 to display frontpage / blog layouts in either a single 100% width'PrimaryColumn' , or in two 50% column widths ('leftColumn' and 'rightColumn').
In the Joomla admin section I can select either one or two columns to be outputted by the code.
The probelm is this -
If I select one column to be outputted both 'PrimaryColumn' AND 'leftColumn 50% width' are displayed - But it should be the only the outer "PrimaryColumn" which is displayed, 'leftColumn' should not be displayed at all.
If I select two columns to be outputted I need the PrimaryColumn to be displayed as a wrapper, and then the leftColumn and rightColumn displayed at 50% width each inside the wrapper.
Here is my code, if anyone could have a look and help me out I would appreciate it! -
<div class="PrimaryColumn">
<?
if ($this->params->def('multi_column_order',1)):
$i = $i + $this->params->get('num_intro_articles');
else:
for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
$column_class =($z > 0) ? 'RightColumn' : 'LeftColumn';
echo '<div class="'.$column_class.'">';
for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
if ($i < $this->total && $i < ($numIntroArticles)) :
$this->item =& $this->getItem($i, $this->params);
echo $this->loadTemplate('item');
$i ++;
endif;
endfor;
echo '</div>';
endfor;
endif;
?>
</div>