Header Text for List Page

8 posts by 3 authors in: Forums > CMS Builder
Last Post: March 17, 2010   (RSS)

By soulint - March 16, 2010

I have create a multi record editor but would like to have a field for generic text that gets displayed only on the list page not the record detail page. Is there anyway to do this?

Re: [gkornbluth] Header Text for List Page

By soulint - March 16, 2010

Thanks for the quick response. One more question is there a way to control how many listings get displayed per row. Let say after 5 listing create a new table row, almost a grid style display?
Scott

Re: [soulint] Header Text for List Page

By gkornbluth - March 16, 2010

Absolutely,

Here's another excerpt from my CMSB Cookbook. You can also limit multi column or multi row groups.

LIMITING THE AMOUNT OF COLUMNS IN A SINGLE ROW IMAGE DISPLAY

Here’s a suggestion from Dave:

The CSS way is to have each image in a div that has something like: style="float: left; width: 200px". This will make them flow from left to right and wrap when they run out of space (you can put them inside a bigger fixed width container).

Or with a table you can have one table cell per image and insert a closing and opening TR every X images. Here's a code snippet that does that:

<?php $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>

Which is just a way of saying "Every 2 images insert "</tr><tr>"".

Here’s a single row example using the thumbnail2 image as a link to a detail page, separate Title and Subtitle fields, a hidden border for IE and a fixed height for the image cell so that everything lines up nicely.

<table width="100%" border="0" cellpadding="5">
<tr>
<?php foreach ($your_sectionRecords as $record): ?><?php foreach ($record['image'] as $upload): ?>
<td align=”center” height="350" valign="bottom">
<a href="<?php echo $record['_link'] ?>"><img src="<?php echo $upload['thumbUrlPath2'] ?>" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" alt="" style="border:hidden" /><br /><div align="center" class="medium-title"><?php echo $record['title'] ?></div>
<div align="center" class="medium-text"><?php echo $record['sub_title'] ?></div></a>
</td>
<?php $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>
<?php endforeach ?><?php endforeach ?>
</tr>
</table>


Similarly, if you’re not using images this code will output a </tr><tr> after every 2 <td>...your content...</td> lines:

<table border="1">
<tr>

<?PHP foreach ($yourrecords as $record): ?>
<td>
<?PHP echo $record['your_content'] ?><br/>
</td>
<?PHP $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?PHP endif; ?>
<?PHP endforeach; ?>
</tr>
</table>


Use your own variable names instead of $yourrecord

Glad to help.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [soulint] Header Text for List Page

By soulint - March 16, 2010

Thanks again thats exactly what I was looking for!!!

Re: [gkornbluth] Header Text for List Page

By soulint - March 16, 2010

Is there any way to do this within the original editor instead of using 2 editors?

Re: [soulint] Header Text for List Page

By gkornbluth - March 16, 2010 - edited: March 16, 2010

I don't think there is because each record in a multi-record editor contains a unique set of data.

I use the common information to hold a whole host of things (metadata like keywords and descriptions, logos, special copyright notices, terms of service, etc.) so it works best for me.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Header Text for List Page

By Chris - March 17, 2010

Hi soulint,

Is there any way to do this within the original editor instead of using 2 editors?


Combining a Single Record section and a Multi Record section (which are related to managing content on the same page) is on my own personal feature request list. :)
All the best,
Chris