Starting a new table of thumbnails after "n" rows are filled?

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

Not strictly a CMSB question, but thought I’d ask anyway.

I’ve got an image gallery that uses Dynamic Drive’s Image Thumbnail Viewer II.

To limit the number of thumbnail images that can be displayed in the table on the left side of the page before a new row is started, I’m using: <?php $maxCols=5; if (@++$count % $maxCols == 0): ?>
</tr>
<tr>
<?php endif; ?>


Whenever a thumbnail is moused over, a large version of that image is displayed in the center of the page.

What my client would like to do is, after 5 rows ( or n rows) have been filled with thumbnails, the next thumbnails should start to populate another table to the right of the larger image.

Since scrolling to see the large image while mousing over a thumbnail is extremely awkward, this approach should allow approximately 40 thumbnails and the large image to always appear centered in the browser window.

I tried playing around with $count but got nowhere.

Any suggestions?

Thanks,

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] Starting a new table of thumbnails after "n" rows are filled?

By Chris - March 29, 2010

Hi Jerry,

Can you provide an example of what the page looks like and maybe a mockup of what you want it to look like? I'm having trouble figuring out exactly what you want.
All the best,
Chris

Re: [chris] Starting a new table of thumbnails after "n" rows are filled?

Thanks Chris,

I'll do that.

Jerry
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] Starting a new table of thumbnails after "n" rows are filled?

By Codee - March 29, 2010 - edited: March 29, 2010

Jerry, if the mouseover is awkward while scrolling the page what about using a simpler html method combined with lightbox so that there's no scrollover, and if a visitor wants to see a larger picture they can click and get an elegant lightbox viewer? would that work?

here's an example:
http://www.oregondecocrete.com/projectDetail.php?Front-porch-22

Re: [chris] Starting a new table of thumbnails after "n" rows are filled?

Hi Chris,

Here's a link to a page that describes what I'm looking for.

http://www.susansaladino.com/artwork.php?group_code=Food-for-Thought

The thumbnail table on the left repeats rows after each 4 images.

After n rows (5 in this particular case) the client wants to start a new thumbnail table to the right of the larger image.

Hope that makes sense.

Best,

Jerry
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] Starting a new table of thumbnails after "n" rows are filled?

By Chris - March 30, 2010

Hi Jerry,

I think the simplest thing to do would be to split your record list in two. 4 * 5 is 20, so:

$leftRecords = array_slice($myRecords, 0, 20); // get 20 records starting at position 0
$rightRecords = array_slice($myRecords, 20, 20); // get 20 records starting at position 20


Then you can have a foreach on each and use the usual $maxCols=4 code.

Does that help? Please let me know if you have any questions.
All the best,
Chris