Table lookups?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: May 16, 2009   (RSS)

By ncasares - May 8, 2009

I'm trying to use CMS Builder to create a photo manager CMS for my client. Here is what I need to accomplish:

- Photos can be uploaded and thumb-nailed - CHECK
- Photos can be tagged with a number and category - CHECK
- Photos can have multiple descriptions in multiple categories - HERE'S WHERE I'M STUCK

The problem is that I need a field that will let my client add multiple descriptions to. Each description needs to be associated with a category. The end goal is that a single photo can be listed in multiple categories by linking from one or more of the photos descriptions.

I think I'm getting stuck on the relation between tables here. I believe I need a second table for descriptions that references the 'photos' table. But then how would I go about referencing a photo from the descriptions table?

Are relationships between tables even possible in CMS Builder?

Any and all help is appreciated.

Re: [ncasares] Table lookups?

By ncasares - May 11, 2009

I did some thinking about this over the weekend and here's as far as I've gotten.

I think this can be accomplished with 3 tables:

- Photos
- Categories
- Descriptions

In the Descriptions table there would be 3 fields for description, category and photo number. The category and photo number fields would be looked up from their respective tables.

Each entry in the Descriptions table would be tied to a specific photo. With this relationship is it possible to retrieve the link to the photo based on the photo number?

I'm stuck on the viewer code that would make this happen.

Thanks.

Re: [ross] Table lookups?

By ncasares - May 16, 2009

Hi Ross,
Thanks for taking time to reply. Your solution would work if I only had one description per image. However, each image will have multiple descriptions that are tied to one or more categories.

Essentially, I'm trying to avoid uploading images more than once while being able to list images in multiple categories. Descriptions may or may not be tied to the same categories as the image, but they will be tied to the image.

I've decided to split descriptions into their own table and just connect them to photos via a lookup. It should accomplish the same thing it just makes the editing process 2 steps instead of 1.

Thanks.