Populate dropdown in Section Editor

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

Hi Dave,

Is there a way to populate a dropdown list that is added to a section with the values from another table?

I have several 'class names' sections, each containing several 'class' records, and a 'class dates' section. When the 'manager' is in the 'class dates' section, I'd like the 'manager' to have the ability to first select one of the tables from a dropdown (one of several) and then depending on what table is selected, populate another dropdown with the records from the table selected. This way there would not be any 'double-typing' which may cause a spelling error in the 'class dates' section 'title' which is used to compare titles when displaying the dates available. Make sense? I only see the ability for the admin to add selections now. [unsure]

TIA!

Eric

Re: [eduran582] Populate dropdown in Section Editor

By ross - February 16, 2009

Hi Eric

I think I know what you mean and there is actually a way with CMS Builder to get that going.

When you are in the Section Editor setting up a new field, there will be an option to have your drop down menu pull its values from a field in one of your other sections.

Just click modify for the list field, and look in the "List Options" area. The second option will be "Get Options From Database". Select that and you'll be able to say which table and which field from that table to use. For most situations, you can have the same field for value and label.

Give that a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Populate dropdown in Section Editor

Thanks, Ross; right there in front of me! A case of "can't see the forest for the tree's", I guess.

Works great for the 'second' step of what I'm trying to do. Is there a way to create a dropdown in the Section Editor that will show a list of all the tables and when the 'manager' selects a table the next dropdown will show the records of that table? I'm guessing I would have to use the 3rd option, "Get options from MYSQL query" to do that (or both) but I'm not sure how that would work.

Any suggestions?

Thanks again for opening my eyes [blush]

Eric