Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Formatting display for Columns & Rows

 

 


BigBear
User

Mar 6, 2008, 3:34 PM

Post #1 of 5 (482 views)
Shortcut
Formatting display for Columns & Rows Can't Post

Hi Dave,

Simple simon here again.. lol

How do I go about placing data in a 4 x 3 table in the order that it comes up.

Is this done with the program, or is this a CSS or Html thing?

Thanks
Rob


(This post was edited by BigBear on Mar 6, 2008, 3:36 PM)


Dave
Staff / Moderator


Mar 6, 2008, 4:24 PM

Post #2 of 5 (478 views)
Shortcut
Re: [BigBear] Formatting display for Columns & Rows [In reply to] Can't Post

Hi Rob,

Thanks for posting to the forum. I responded by email but here's the same response for anyone else who wants to do the same:

The first step is creating a mockup table of how you want it to look.

Next have it output all the listings and you could use some PHP code like this to insert something every X items.

<?php $maxCols=3; if (++$count % $maxCols == 0): ?>
<br/>
<?php endif ?>

So say you have a table, and you want to display 3 records one after another, then close and open a table cell with: </td><td valign="top"> You'd use:

<?php $maxCols=3; if (++$count % $maxCols == 0): ?>
</td><td align="top">
<?php endif ?>

Give it a try and let me know how it goes. If you get stuck just post the url to your mockup table and your test page and we'll help you out.

Dave Edis - Senior Developer
interactivetools.com


matrix
User

Mar 8, 2008, 10:03 AM

Post #3 of 5 (460 views)
Shortcut
php count [In reply to] Can't Post

Using your suggestion as a way to get thumbnails to write in 2 column rows as follows:
<?php $maxCols=2;
if (++$count % $maxCols == 0): ?>
</td><td align="top"><?php endif ?>

Looks like it's working okay, but this error message precedes it, which sorta kills the effect Wink :
"Notice: Undefined variable: count in /home/web/public_html/interior.php on line 89"

Is there some place $count is supposed to be defined as a variable? If so, where and how, please?

Sorry about this second question du jour, but am closing in on what's turned out to be a more difficult goal with CMS Builder than I had anticipated. Looking good, at least up to the error message.

Many, many thanks for your help.
Happy Interactive Tools product user since 1999


Dave
Staff / Moderator


Mar 8, 2008, 12:58 PM

Post #4 of 5 (456 views)
Shortcut
Re: [matrix] php count [In reply to] Can't Post

Try adding a @ before the ++ like this:


Code
<?php $maxCols=2; 
if (@++$count % $maxCols == 0): ?>
</td><td align="top"><?php endif ?>


And that should fix it. In PHP putting the @ symbol in front of something means "don't show error messages for this". Another way would have been to define count at the top of your page like this: <?php $count = 0; ?> but I'd just use the @ as it keeps everything in one place and makes for less code to keep track of.

Hope that helps, any other questions just let me know. :)

Dave Edis - Senior Developer
interactivetools.com


matrix
User

Mar 8, 2008, 1:50 PM

Post #5 of 5 (451 views)
Shortcut
Re: [Dave] php count [In reply to] Can't Post

Perfect! Works great.

Thank you so much.
Happy Interactive Tools product user since 1999

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4