Populate List Field Editor From Multiple Tables

7 posts by 2 authors in: Forums > CMS Builder
Last Post: December 22, 2011   (RSS)

Hello,
I have not yet tried this, but I was wondering if it is possible to populate a list field editor with data from multiple tables by utilizing the Advanced MySQL Query area.

Thank you.

Re: [steve99] Populate List Field Editor From Multiple Tables

By Jason - December 22, 2011

Hi,

Yes, you could probably do this, but it would be a fairly complex query.

Can you give an example of a situation where you would need to do that?
---------------------------------------------------
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: [steve99] Populate List Field Editor From Multiple Tables

By Jason - December 22, 2011

Hi,

Okay, I see where you're going. I like the idea of having a "Site Controls" section.

One suggestion that I would make that might make this a little easier for you would be to have 1 section for products. In that section, you can have a list of "product types" (ie, electric guitars, acoustic guitars, etc). You then select a product type for each product. This would allow you to just have to worry about pulling in information from a single section. You would also have a central place for data entry and would be able to use a single listPage / detailPage set to show all products.

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] Populate List Field Editor From Multiple Tables

I totally agree that would be muuuch easier to work with! In that case, for this situation, the list would be huge. We were sectioning off the different product lines into their own respective list editors to be easier on the clients end to work with and sort through - at their request.

Re: [steve99] Populate List Field Editor From Multiple Tables

By Jason - December 22, 2011

Hi,

The problem here is that you would need to have a single field that would be unique across all the tables that are being queried. You would also have to have a way of determining which table an individual record came from. Although this is probably possible, the complexity would most likely outweigh any benefits.

If they're worried that a single list would be too large, you can easily set up a search in the CMS to allow them to filter their list by product type. If they already have things in multiple tables, it would also be fairly easy to create a script that would merge them into 1. This is definitely going to be the best approach.

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] Populate List Field Editor From Multiple Tables

Hi,
I am in total agreement. I can foresee a lot of programming hours to handle something that complex. Hopefully I can push them in the other direction, and maybe explaining the extra cost may have them change their mind :)

Thanks, Jason! Happy Holidays!