Filter section editor by dropdown field label

5 posts by 3 authors in: Forums > CMS Builder
Last Post: December 20, 2022   (RSS)

By pgplast - August 22, 2022 - edited: August 22, 2022

I have an install of CMSB with a section editor called "Lecture for Symposium." One of the fields in this table is a list called, "Parent Symposium" that is derived from a MySQL call to the "symposia" table.

The user may filter a list of programs based upon a choice from the "parent_symposium" field. These values are the indices of the other table since it is called using: SELECT num,title FROM symposia

The symposium list is growing very long as programs are developed, and the site owner has asked if she might filter the list based upon the text in the labels of the dropdown rather than by the index value.

I made a quick attempt at this, (just to see if I might be lucky), by doing the following:

The original searching settings

Parent Symposium|parent_symposium|match
Title|title|query

The latered settings

Parent Symposium|parent_symposium|match

Parent Symposium Text|parent_symposium:label|query
Title|title|query

---------

This, of course, does not work.

Is there an existing workaround within cmsb for this, of must a plugin be written?

Thanks.

pgplast

By daniel - August 22, 2022

Hi pgplast,

When using a match search on a list field, it should by default create a dropdown where the user can select based on the label when filtering the list view. In this case, I would expect it to use the "title" field from symposia. Is this not what is happening? Or have I misunderstood and there is something else you're trying to do?

Thanks,

Daniel
Technical Lead
interactivetools.com

By daniel - August 22, 2022

Hi pgplast,

Thanks for the additional detail - I understand now! Unfortunately, I don't think this is possible with the current section search functionality. I think this would be a good feature for us to add at some point, but currently, a custom plugin appears to be necessary. The simplest way I can think of is to have a plugin save the label text to a hidden field any time the record is updated, and set up the filter to search that hidden field instead. It duplicates some data, but would be pretty quick to create.

Let me know if you have any questions! Or if you'd like our help in setting this up, feel free to send us an estimate request: https://www.interactivetools.com/estimate/

Thanks,

Daniel
Technical Lead
interactivetools.com