Searching on custom field on media items in the media library?
Hi, I've added a custom field to media items for year. But I've noticed when using the search you can't search on this field, it only searches on the media item name. Is this something I'm able to make the search include? If so, where can I edit this?
It applies to a custom search of a custom ListView but the concept will be the same for doing so on Media, it's a question of finding which request to hook into by opening up dev tools and looking to see what it's currently requesting when search is actioned...
Searching on custom field on media items in the media library?
Hi, I've added a custom field to media items for year. But I've noticed when using the search you can't search on this field, it only searches on the media item name. Is this something I'm able to make the search include? If so, where can I edit this?
Hi Ras
Are you talking about the Backoffice Search?
If so, then yes you can update the list of UmbracoTreeSearcherFields for Media and add your customer, properties to be searched there.
How you do it varies depending on the version of Umbraco you are running, so on the VLatest Dot Net Core versions there is an example here:
https://docs.umbraco.com/umbraco-cms/extending/backoffice-search#adding-custom-properties-to-backoffice-search
In V8.6, it's slightly different:
https://our.umbraco.com/Documentation/Extending/Backoffice-Search/#adding-custom-properties-to-backoffice-search
regards
Marc
Hi Marc,
Well, I was thinking specifically about the search contained in the backoffice media library as opposed to the global search, if that makes sense.
Hi Ras
Ahhh, you mean in the ListView? that search within the media section...
Have a look at this article:
https://dev.to/skttl/how-to-customize-searching-in-umbraco-list-views-1knk
It applies to a custom search of a custom ListView but the concept will be the same for doing so on Media, it's a question of finding which request to hook into by opening up dev tools and looking to see what it's currently requesting when search is actioned...
regards
Marc
Hi Marc,
Thank you, it seems like a good starting point for what I need!
is working on a reply...