Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

remove field use as a title from search by input

default discord avatar
agolovanlast year
5

Currently, such field always appears at search by input. We could add more fields. Is it any way to remove that field from search by? The problem is that we set a virtual field as a tile and users are confused about what Is that field is coming from.



Location Title is a virtual field that set as a title, and we just added Custom ID there that is a real field. We would like to remove Location Title from search by input.

  • default discord avatar
    jessrynkarlast year

    Hi

    @956827460975083550

    - you should be able to achieve this by defining

    listSearchableFields

    on your collection. Define the array and only include the fields that you want to search against, like this:



    admin: {
      listSearchableFields: ['customID']
    } 


    https://payloadcms.com/docs/configuration/collections#list-searchable-fields
  • default discord avatar
    agolovanlast year

    Hi

    @854377910689202256

    Yes - I did that and put CustomID only into this array, but virtual field that is set to used as title - Location Title - is still displayed first, please see the image.

  • default discord avatar
    jessrynkarlast year
    @956827460975083550

    ah I see the issue now,

    listSearchableFields

    does not overwrite the default search input... I'm not sure what the best solution is here. If you could open an issue over on GitHub for us we can look into it properly next Monday 🐛

    https://github.com/payloadcms/payload/issues
  • default discord avatar
    agolovanlast year

    I will - thank you!



    @854377910689202256

    https://github.com/payloadcms/payload/issues/3067
  • default discord avatar
    jessrynkarlast year

    Perfect thank you

    @956827460975083550

    - I'll loop back when we get this resolved 👍

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.