I want to addthis piece of code, every fours items after it close </div>
Code: Select all
<ul>
<li>
<div class="box">
<!--All fields and information here-->
</div>
<div class="h2"></div>
<div class="box">
<!--All fields and information here-->
</div>
<div class="h2"></div>
<div class="box">
<!--All fields and information here-->
</div>
<div class="h2"></div>
<div class="box">
<!--All fields and information here-->
</div>
<div class="h2"></div>
</li>
</ul>
I currently have this piece of code, which builds a list per every <div class="box">, then closes the item </div> and start another one as same.
SEE current CODE.
Code: Select all
<?php
$dealList = $this->dealList;
if(count($dealList)==0) echo '<h3>'.JText::_('NO_DEAL_MESSAGE').'</h3>';
$count = 1;
foreach ( $dealList as $row):
$link = 'index.php?xxx=' . $row->id;
if(!Helper::is_urlEncoded($row->pic_dir))
{
$imageUrl = $row->pic_dir;
}
else
{
$imageUrlArr= unserialize(urldecode($row->pic_dir));
$imageUrl = str_replace("\\","/",$imageUrlArr[0]);
}
?>
<div class="box">
information fields here
</div>
<?php if ($count%2==1){?>
<div class="h2"></div>
<?php }
else if($count%2==0){?>
<div class="h3"></div>
<?php }$count++ ; endforeach;?>
Code: Select all
<ul>
<li>
<div class="box">
information fields
</div>
</li>
</ul>