Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

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

admin

Started by Samuele Masetto 5 years ago · 12 replies · 782 views
5 years ago

Hi,
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.

5 years ago

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

5 years ago

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

5 years ago

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

5 years ago

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

5 years ago

@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

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

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

5 years ago

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 :(

5 years ago

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?

5 years ago

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 🤔

Edit:
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.

last edited 04/16/21 by Karmalakas
5 years ago

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

5 years ago

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.

5 years ago

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

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 43 1 week ago
Plugins · by Xavier, 4 weeks ago
2 54 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1181 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 48 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 73 2 months ago