moss2076
03-17-2009, 02:54 PM
Hello :)
I am designing the frontpage of my website, im using Joomla 1.5 and have customized the Beez frontpage template file (frontpage/default.php) for use in my own template. It is a table-less design.
The layout for frontpage articles (frontpage/default.php file) is a two-column layout. There are six articles set to display on the front page in the two columns.
As you can see from the link - http://www.tomsspecialreserve.co.uk/joomla
there are gaps underneath some articles. I dont want the big gaps. I think the gaps are caused by the line <div class="article_row<?php echo $this->params->get('pageclass_sfx'); ?>"> which is highlighted with a blue border, so I tried removing the line from my code.
Removing the line got rid of the gaps, but sent the frontpage articles way out of position with each other, totally out-of-line with each other, and I am now totally stuck trying to work out how to make the articles line up in columns without any big gaps. Im not good with PHP :o
The code for my frontpage/default.php file is -
<?php
$introcount = $this->params->def('num_intro_articles', 4);
if ($introcount) :
$colcount = $this->params->def('num_columns', 2);
if ($colcount == 0) :
$colcount = 1;
endif;
$rowcount = (int) $introcount / $colcount;
$ii = 0;
for ($y = 0; $y < $rowcount && $i < $this->total; $y++) : ?>
<div class="article_row<?php echo $this->params->get('pageclass_sfx'); ?>">
<?php for ($z = 0; $z < $colcount && $ii < $introcount && $i < $this->total; $z++, $i++, $ii++) : ?>
<div class="article_column column<?php echo $z + 1; ?> cols<?php echo $colcount; ?>" >
<?php echo $this->params->get('pageclass_sfx'); ?>
<?php $this->item =& $this->getItem($i, $this->params);
echo $this->loadTemplate('item'); ?>
</div>
<?php endfor; ?>
</div>
<?php endfor;
endif; ?>
and the CSS is -
.cols1
{
display: block;
float: none !important;
margin: 0 !important;
}
.cols2 { width: 45%; }
.cols3 { width: 30%; }
.column1 , .column2
{
border: solid 0px #D4A7C5;
margin: 0 5px 0 0;
position: relative;
}
.column2 , .column1
{
float: left;
margin: 0;
}
.column2
{
float: right;
margin: 0;
width: 45%;
}
.article_row
{
margin: 0px 0 0px 0;
padding: 0;
overflow: hidden;
}
.article_column
{
border: solid 0px #ccc;
padding: 50px 10px 10px 0;
margin: 0px 0px 0px 0px;
}
So I just want two columns eg Column1 and Column2 with the articles in each, lined up and in position, but I think different PHP code is needed to achieve this, and I have looked every where for an example, but cannot find one - HELP!!
I am designing the frontpage of my website, im using Joomla 1.5 and have customized the Beez frontpage template file (frontpage/default.php) for use in my own template. It is a table-less design.
The layout for frontpage articles (frontpage/default.php file) is a two-column layout. There are six articles set to display on the front page in the two columns.
As you can see from the link - http://www.tomsspecialreserve.co.uk/joomla
there are gaps underneath some articles. I dont want the big gaps. I think the gaps are caused by the line <div class="article_row<?php echo $this->params->get('pageclass_sfx'); ?>"> which is highlighted with a blue border, so I tried removing the line from my code.
Removing the line got rid of the gaps, but sent the frontpage articles way out of position with each other, totally out-of-line with each other, and I am now totally stuck trying to work out how to make the articles line up in columns without any big gaps. Im not good with PHP :o
The code for my frontpage/default.php file is -
<?php
$introcount = $this->params->def('num_intro_articles', 4);
if ($introcount) :
$colcount = $this->params->def('num_columns', 2);
if ($colcount == 0) :
$colcount = 1;
endif;
$rowcount = (int) $introcount / $colcount;
$ii = 0;
for ($y = 0; $y < $rowcount && $i < $this->total; $y++) : ?>
<div class="article_row<?php echo $this->params->get('pageclass_sfx'); ?>">
<?php for ($z = 0; $z < $colcount && $ii < $introcount && $i < $this->total; $z++, $i++, $ii++) : ?>
<div class="article_column column<?php echo $z + 1; ?> cols<?php echo $colcount; ?>" >
<?php echo $this->params->get('pageclass_sfx'); ?>
<?php $this->item =& $this->getItem($i, $this->params);
echo $this->loadTemplate('item'); ?>
</div>
<?php endfor; ?>
</div>
<?php endfor;
endif; ?>
and the CSS is -
.cols1
{
display: block;
float: none !important;
margin: 0 !important;
}
.cols2 { width: 45%; }
.cols3 { width: 30%; }
.column1 , .column2
{
border: solid 0px #D4A7C5;
margin: 0 5px 0 0;
position: relative;
}
.column2 , .column1
{
float: left;
margin: 0;
}
.column2
{
float: right;
margin: 0;
width: 45%;
}
.article_row
{
margin: 0px 0 0px 0;
padding: 0;
overflow: hidden;
}
.article_column
{
border: solid 0px #ccc;
padding: 50px 10px 10px 0;
margin: 0px 0px 0px 0px;
}
So I just want two columns eg Column1 and Column2 with the articles in each, lined up and in position, but I think different PHP code is needed to achieve this, and I have looked every where for an example, but cannot find one - HELP!!