Sorting Results in Tables

7 posts by 2 authors in: Forums > CMS Builder
Last Post: September 11, 2008   (RSS)

Re: [kitka] Sorting Results in Tables

By Dave - September 4, 2008

Hi Jim, welcome to the CMS Builder forum! :)

You can link a thumbnail to a larger image with this code (changes in red):

<a href="<?php echo $upload['urlPath'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" border="0" /></a><br><br>

And for splitting the images into 2 tables yes it's possible. There's a few ways to do it. One would be a large table with 2 columns. One for the content and one for the images.

The first step is to create an html mockup of what you want it to look like. Then post a link to that and we can give you some ideas on how to make it work.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Sorting Results in Tables

By kitka - September 4, 2008

ok here is what is presently ( the .php file)
http://www.rocaroalpacas.ca/males2.php

HERE IS WHAT I WANT IT TO LOOK LIKE...

http://www.rocaroalpacas.ca/males2.html

THNAKS JIM
jim albert

Re: [kitka] Sorting Results in Tables

By Dave - September 4, 2008

Try something like this:

<table>

<?php foreach ($malesRecords as $record): ?>
<tr>
<td valign="top">
Insert text fields here:

Title: <?php echo $record['title'] ?><br/>
name: <?php echo $record['name'] ?><br/>
dob: <?php echo $record['dob'] ?><br/>
etc...

</td><td>

Insert images here

<?php foreach ($record['mainphoto'] as $upload): ?>

<a href="<?php echo $upload['urlPath'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" border="0" /></a><br><br>
<?php endforeach ?>

</td>
</tr>
<?php endforeach ?>
</table>


Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [kitka] Sorting Results in Tables

By kitka - September 11, 2008

Ok thanks...

One other question....


How can i make the images when i click on them open up in anew browser window on top of the page...
I don't want people clicking out of the site....

The present code looks like this:

Insert images here

<?php foreach ($record['mainphoto'] as $upload): ?>

<a href="<?php echo $upload['urlPath'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" border="0" /></a><br><br>
<?php endforeach ?>

</td>

jim albert

Re: [kitka] Sorting Results in Tables

By Dave - September 11, 2008

Try adding this code (in red): target = "_blank"

<?php foreach ($record['mainphoto'] as $upload): ?>
<a href="<?php echo $upload['urlPath'] ?>" target="_blank"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" border="0" /></a><br><br>
<?php endforeach ?>


Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Sorting Results in Tables

By kitka - September 11, 2008

Thanks Dave...

It works great....Knew it had to go somehere but wasn't quite sure...

Thanks for all your help

JIM
jim albert