Details on list page displaying wrong

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

Re: [Kittybiccy] Details on list page displaying wrong

By zip222 - September 8, 2010

The problem you're having is actually not related to the php - it's CSS-related. Specifically floating and clearing. If you can post just the repeating area of the page, including the php, I can give you a hand.

Re: [zip222] Details on list page displaying wrong

By Kittybiccy - September 8, 2010

Thanks Zip. Here's the code:
<td class="bodytext"><!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
<div id="studio_content">
<?php foreach ($studio_shopsRecords as $record): ?>

<div id="studio_image"> <?php foreach ($record['studio_portrait'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

<?php endif ?>
<?php endforeach ?>
<img src="images/15pxwhitesquare.jpg"></div>

<div id="studio_text"><span class="redheadings"><?php echo $record['title'] ?></span><br/>
<?php echo $record['intro'] ?>
<strong> <a href="<?php echo $record['_link'] ?>" class="bodytext"> Read More...</a></strong><br/>
</div>
</div><br><br>

<?php endforeach ?>

<?php if (!$studio_shopsRecords): ?>
No records were found!<br/>
<?php endif ?>
<!-- /STEP2: Display Records --></td>

Re: [Kittybiccy] Details on list page displaying wrong

By zip222 - September 8, 2010

Try this, note the change and addition in bold:

<td class="bodytext">
<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
<?php foreach ($studio_shopsRecords as $record): ?>
<div id="studio_content">
<div id="studio_image">
<?php foreach ($record['studio_portrait'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
<?php endif ?>
<?php endforeach ?>
<img src="images/15pxwhitesquare.jpg">
</div>
<div id="studio_text">
<span class="redheadings"><?php echo $record['title'] ?></span><br/>
<?php echo $record['intro'] ?>
<strong><a href="<?php echo $record['_link'] ?>" class="bodytext"> Read More...</a></strong><br/>
</div>
<div style="clear:both;"></div>
</div>
<br><br>
<?php endforeach ?>

<?php if (!$studio_shopsRecords): ?>
No records were found!<br/>
<?php endif ?>
<!-- /STEP2: Display Records -->
</td>

Re: [zip222] Details on list page displaying wrong

By Kittybiccy - September 8, 2010

Worked a treat, thank you :)