CMS Builder - Photo Gallery

14 posts by 5 authors in: Forums > CMS Builder
Last Post: April 24, 2008   (RSS)

Hello,

I recently started working with CMS Builder and I am trying to create a photogallery where I can have my client upload pictures. I really don't mind to much on how they display, but I would like them to display thumbnails then when you click on the image it would get larger. Please let me know if there is any documentation out there for this, I admit I am still weak with the CMS Builder.

Thanks,

Brett

Re: [bmatthews] CMS Builder - Photo Gallery

By Dave - February 21, 2008

Hi Brett,

You can have CMS Builder display photos just about anyway you might need. You just need to move the tags around.

By default it will show thumbnails for uploads if they're available. To add a link to the full size image you'd just change this code:

<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>"
alt="" /><br/>


To this:

<?php if ($upload['hasThumbnail']): ?>
<a href="<?php echo $upload['urlPath'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>"
alt="" /></a><br/>


Hope that makes sense, let me know if I can provide more details.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CMS Builder - Photo Gallery

By bmatthews - March 7, 2008

Hey Dave,

Been a few days since I talked to you. I got the photo page working and I am able to upload to it.

Now on the following URL all the pictures go directly down the page. Is there some type of code I can add that will take these pictures and put them into columns and/or rows.

Here is the URL that I am talking about.

http://www.shoreshot.net/photopage.php

Thanks,

Brett

Re: [bmatthews] CMS Builder - Photo Gallery

By Dave - March 7, 2008

Hi Brett,

Yes, there's several ways to do that. The best way to proceed is usually to experiment with that on a html mockup page until you find the one the works best and then add it to the viewer page.

One method you could try is adding this to the image tag:

<img ... style="float: left" ... >

Let me know if that works for you. If not we can figure out something else.
Dave Edis - Senior Developer
interactivetools.com

The markup?

By matrix - March 8, 2008 - edited: March 10, 2008

Removing this post. Please see Dave's wonderful, versatile solution as a code block below.
Happy Interactive Tools product user since 1999

Re: [matrix] The markup?

By Dave - March 9, 2008

Do you have a link to the test page or can you attach the viewer so I can have a look at the code?

My first guess is that maybe you want </tr><tr> instead of </td></td>.

So you'd have something like this:

<table><tr>
<?php foreach (getUploads(...)): ?>

<td><img ... ></td>

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

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


If that's not it post a link to the page or attach the code and let me know the dimensions (2 columns right?) and I'll help you get it working quick.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] The markup?

By matrix - March 9, 2008 - edited: March 10, 2008

Thank you so much for this nice, clean code block. It works perfectly and really clarifies for me the relationship of the php tags to the html.

You rock!

#################################

<!-- THUMBNAILS BEGIN -->
<table border="0" cellpadding="8" cellspacing="0" width="100%"><tr>

<?php if ($listDetails['noRecordsFound']): ?>
<td>No records were found!</td>
<?php endif ?>

<?php foreach ($listRows as $record): ?>
<?php foreach (getUploads($options['tableName'], 'uploads', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>

<td valign="top">
<a href="<?php echo $record['_link'] ?>">
<?php echo $upload['info1'] ?><br/>
<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>" /></a>
</td>

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

<?php endif ?>
<?php endforeach ?>
<?php endforeach ?>

</tr></table>
<!-- THUMBNAILS END -->

################################
Happy Interactive Tools product user since 1999

Re: [matrix] The markup?

By Kenny - April 23, 2008

Can't get this to work at all http://www.nele.us/photos on the photos page.

help?

Re: [sagentic] The markup?

By Jake - April 23, 2008

Hi sagentic,

Thanks for posting. [:)]

Everything seemed to be working correctly for me here:

http://nele.us/photos/photos.php/

Am I overlooking something, or did you get this resolved? Let us know if you still need our help!
-----------------------------------------------------------
Cheers,
Jake Marvin - Product Specialist
support@interactivetools.com

Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.