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 Dave - April 6, 2008

Glad you figured it out and thanks for posting the link for others! I'll get your next question! :)
Dave Edis - Senior Developer
interactivetools.com