Search/Where upload is blank

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 23, 2010   (RSS)

Re: [rjbathgate] Search/Where upload is blank

By Jason - June 23, 2010

Hi,

The way CMS Builder works is it doesn't actually store upload information in the database section you create. Instead it puts all upload information in another table called uploads (you can't see it as a section). These uploads are loaded automatically when you use the getRecords function.

What you can do is return all records (whether they have an upload or not) and then you can use code to check each record.
For example:

<?php foreach ($productRecords as $record): ?>
<?php if($record['photographs']):?>
*RECORD HAS UPLOADS IN PHOTOGRAPHS FIELD*
<?php else: ?>
*RECORD DOESN'T HAVE UPLOADS IN PHOTOGRAPHS FIELD*
<?php endif ?>
<?php endforeach ?>


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Search/Where upload is blank

By rjbathgate - June 23, 2010

Thanks for the reply...

Yeah I thought that would be the case as its a seperate table.

If i run a foreach and then 'ignore' non image ones, it messes with a whole bunch of other stuff (page nav etc), so I'd have to look at using that first foreach to create a new array and then run the results based on that...

Thanks anyway, I'll give it some thought and play around

Cheers