Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Get options from database

 

 


mediaco
Novice

Nov 22, 2011, 8:01 AM

Post #1 of 2 (276 views)
Shortcut
Get options from database Can't Post

I have a University site using CMSB.

In the CMS there are a list of courses, table named COURSES.

There is a separate table named VIDEOS that contains a name and an uploaded FLV "video_file".

In COURSES, I want to allow the CMS user to select an item from VIDEOS via a pull down list.

I can do this by selecting 'Get options from database (advanced)'. But i am only then given the name.

Ideally I would like to output the name, urlPath and thumbNail details of the relevant upload.

Can this be done?


Jason
Staff / Moderator


Nov 22, 2011, 10:27 AM

Post #2 of 2 (268 views)
Shortcut
Re: [mediaco] Get options from database [In reply to] Can't Post

Hi,

The reason you're only getting the name as an option is that all upload information is actually stored in a separate uploads table. Also, when choosing options, only the value you select for "option value" will be stored in the database.

Probably the best approach would be to use the "num" field from videos as your option value for your drop down in courses. Then, when you are outputting your courses, you can do a second query to the videos table to get the related video record. If you use getRecords() to do this, CMS Builder will automatically append the upload information to the video record.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

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