Admin Search

edited March 2014 in Modules
Just curious, I don't see much in the docs about this but how exactly does the search in the admin work for modules. I have one module where the display_field is set to the DB field `description` and it searches great on that field but not on any other field. Is there a way to force the fields that are searched on?

Comments

  • edited March 2014
    Yes. You can use the model property "filters" and specify an array of model fields you want to include in the search. There is also a "filter_join" property which can be either "and" or "or" or an array with the key being the field name and the value being either "and" or "or".
    public $filters = array('description', 'title', 'name', 'excerpt');
    Lastly, you can always overwrite your list_items method to include joins, additional selects, etc (some of the existing fuel models do this already).
Sign In or Register to comment.