How to Create a Global Dropdown List (list options)

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

Re: [yodare] How to Create a Global Dropdown List (list options)

By Chris - October 14, 2009

Hi yodare,

I think the best way to accomplish something like this would be use a section and create 100 records with 1 field each.

Is there some specific reason you don't want to do this?
All the best,
Chris

Re: [chris] How to Create a Global Dropdown List (list options)

By yodare - October 14, 2009

Hi Chris.

There are actually a couple reasons. . .

1. Don't really want to create 100 records and then cut/paste 100 times for each drop-down list item [crazy]. Unless I can batch records from text file array or CSV??
2. Would like to create some kind of template for "global" values. (ex: "Available Colors" list options for product A, B, and C would be different from products D, E, and F)

Lets say you have Possible Color Names based on each manufacturer. And you have a section to create records for products by each manufacturer. AND the Color Names change every year.

Is there any way to swap out last year's Color Names list with this year's Color Names list with a single copy/paste?

Thanks!

Re: [yodare] How to Create a Global Dropdown List (list options)

By Chris - October 15, 2009

Hi yodare,

1. Don't really want to create 100 records and then cut/paste 100 times for each drop-down list item Crazy. Unless I can batch records from text file array or CSV??


There are many ways to speed up inserting 100 records. phpMyAdmin has an Insert feature which lets you enter up to 40 records on a single page; I believe it also has a CSV import feature. Another approach would be to use CMS Builder's Database Backup feature and manually edit the SQL file to add your own rows, then Restore it (copy the backup file in case something goes wrong!)

Once you've got your records in your database, you won't need to copy and paste anything. You can set your List Field to "Get options from database (advanced)" and specify the section which has your options.

Is there any way to swap out last year's Color Names list with this year's Color Names list with a single copy/paste?


You can use any of the techniques above to DELETE and INSERT multiple records at a time. We could also build you a tool to do this through our Consulting service.

2. Would like to create some kind of template for "global" values. (ex: "Available Colors" list options for product A, B, and C would be different from products D, E, and F)


That's getting a little more complicated. Your Colour_List section could have a "category" (or "manufacturer") field and your Product section could have a "colour_list_category" (or "manufacturer") field. By using the "Get options from MySQL query (advanced)" feature, you can have the selection of one pulldown change the options available in another pulldown.

I hope this helps give you some ideas. If you have any trouble setting things up, please let me know.
All the best,
Chris

Re: [chris] How to Create a Global Dropdown List (list options)

By yodare - October 16, 2009

OK. . . Thanks for clearing that up. Sounds like I'll have to create a custom workaround. Just didn't want to "re-invent the wheel" if CMSB Admin area already had a simple way to import/input large global data lists.

Thanks Chris!