Layout and display issue

5 posts by 2 authors in: Forums > CMS Builder
Last Post: September 26, 2011   (RSS)

Re: [kcmedia] Layout and display issue

By Jason - September 23, 2011

Hi Craig,

I think this is what you're looking for:

<div id="page_left">
<div class="grid_4">
<h2 class="comm_title">used motorcycles</h2>
<ul class="shop_list">
<?php
$maxRecordsPerDiv = 4;
$recordCount = 0;
?>
<?php foreach ($used_motorcyclesRecords as $record): ?>
<?php if ((++$recordCount % $maxRecordsPerDiv) == 0): ?>
</ul>
</div>

<div class="grid_4 push_1">
<h2 class="comm_title">&nbsp;</h2>
<ul class="shop_list">
<?php endif ?>

<li>
<div class="left">
<h3 class="title"><?php echo $record['title'];?></h3>
<p class="desc"><?php echo $record['content'];?></p>
</div>
<div class="img">
<?php if ($image = @$record['images'][0]): ?>
<a href="<?php echo $record['_link'];?>"><img src="<?php echo $image['thumbUrlPath'];?>" alt="" /></a>
<?php endif ?>
</div>
</li>

<?php endforeach ?>
</ul>
</div>


It will output the first 4 records into 1 div, then create a second div to output the last 4.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Layout and display issue

By KCMedia - September 23, 2011

Hi Jason

that didnt work i get this error

Notice: Undefined variable: used_motorcyclesRecords in /var/www/vhosts/gasolinecustomgarage.com.au/httpdocs/newsite/used-motorcycles.php on line 103 Warning: Invalid argument supplied for foreach() in /var/www/vhosts/gasolinecustomgarage.com.au/httpdocs/newsite/used-motorcycles.php on line 103


also now there is only 1 div on the left where does the one on the right showup there are 2 divs one called grid_4 and grid_4 push_1 that pushes the 2nd div to the right float on the page does this all matter.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

used-motorcycles_007.php 7K

Re: [kcmedia] Layout and display issue

By Jason - September 26, 2011

Hi Craig,

I took a look at your file and the getRecords call that you had posted in your original post is missing from your file:

// load records
list($used_motorcyclesRecords, $used_motorcyclesMetaData) = getRecords(array(
'tableName' => 'used_motorcycles',
'perPage' => '8',
));


This is the call that gets the records out of the database to display in your divs.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Layout and display issue

By KCMedia - September 26, 2011

Hi Jason

thanks for that dont know what happend there but all good now.

cheers
Thanks



Craig

KC Media Solutions

www.kcmedia.biz