Search pages by slug or title in Admin (Grav version 1.7)

how can I search also by slug and page title in the admin page search?
Now it seems that only the folder name is searched for.

Thank you.

@samuele, You might want to consider creating a feature request when not already existing…

@pamtbaau I was hoping there would be an option somewhere to specify where to look. :blush:
If you also notice that there isn’t, then I’ll open an issue

I believe extending grav-plugin-flex-objects/blueprints/flex-objects/pages.yaml and adding something like:

        - folder
        - title
        - slug

should do it. You have to check fields though - I typed these without checking

@Karmalakas, I like to think searching on title should be available out-of-the-box…

Basically pages are flex objects and flex objects config (scroll down a bit to the section explaining search) accepts which fields should be searchable.

If that’s not enough, please check The Modification section step 5 on the Readme of FO - you might need to extend a template too

@Karmalakas thank you for your the suggestion.
I tried doing as you say and as stated in the documentation, but it doesn’t work.

I then tried changing the yaml file system/blueprints/flex/pages.yaml directly by inserting

       # Search options
        contains: 1
      # Fields to be searched
        - key
        - menu
        - title
        - name
        - slug

but again I do not notice any difference in the search. And not even search by title :roll_eyes:

Check my previous comment about The Modification section step 5 on the Readme of FO. Maybe this would help. I’m at work now, so can’t really test everything :frowning:

HI @Karmalakas, I tried many times, but without success.
I also tried changing the yaml file system/blueprints/flex/pages.yaml directly by inserting other searchable fields, but the search only works with folder name.
it is not possible to search by title either, even though the ‘title’ field is present in the yaml file.

Please can you try as well?

I will check after work or tomorrow how I have done my custom flex objects. I have multiple fields searchable and I assume it shouldn’t be very different for Pages :thinking:

Apparently you are right and there’s something wrong. It seems like a bug. My custom FOs work perfectly fine and that JS looks like is just for table output.

Did some debugging and I’m pretty confident it’s a bug. Not sure how to solve though, so created an issue

Thank you @Karmalakas for opening this issue, but nobody has answered yet. :disappointed_relieved:
I think it’s better to move it to grav-plugin-admin repository.

Well… Pages are very tightly related to whole core, so wasn’t sure. Maybe one of the devs can move the issue if necessary