Displaying Upload Field Data

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 6, 2008   (RSS)

By DHester - April 4, 2008 - edited: April 4, 2008

I'm creating a blog/news section on my site using CMS Builder. With each post, the user will have an option to create a gallery of related images using the 'upload' field type. Works great but I need to add some conditional logic:

If record exists and the 'Gallery' upload field has at least 1 photo in it then:

Display a custom CSS div with all the images inside

Else:

Don't show any CSS div for the gallery / Don't show any images.



Make sense? Right now my code displays a empty gallery box if no images are in the upload field. I'd prefer not to show anything at all ( no gallery box ).

I need to check if 'gallery' contains any items before the foreach is executed to display the items:

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

Can someone point me in the right direction?

Thanks [;)]
Darren Hester
www.designsbydarren.com

Re: [DHester] Displaying Upload Field Data

By DHester - April 5, 2008

For those looking for a solution to this, I found the answer I need here:

http://www.interactivetools.com/iforum/gforum.cgi?post=59803

It worked great!
Darren Hester
www.designsbydarren.com