Can pages select field be searched?

Hello.

There is pages selector widget (field): https://getkirby.com/docs/reference/panel/fields/pages

2019-03-09_15-02-18

It’s very handy but what I have more than 100 pages in my “Notes” section, at example? I will need to scroll all of this pages to select one of them… May be there is a way to search (query) pages by title there? Or another widget exists with search functionality there?

Thank you in any advance :slight_smile:

You can switch to cards layout which will give you a pager…

pager

But i think the list will also give you a pager if you get a list long enough.

Pager, but not Search?

Ok, thank you anyway :slight_smile:

Will wait for plugin or field extension in future Kirby releases…

Or will learn hard and do it myself :slight_smile:

No, I don’t believe there is a search facility on it. But you can use the query language to reduce the list by only display children of the current page for example.

Yes, reducing pages list by query is good idea, but it will work only for limited range of site sections. There is pages where editors must have access to full list of site pages to linking them from pages list field…

You can re-use sections, and declare different ones with different queries in your blueprints. :slight_smile:

See here.

In other words, you can set your pages section up in a shared file, and when you use it in the blueprint, you can extend it and overide the query depending on what page it is being used on.

1 Like

To your initial questions: No, this is currently not possible. However, there is an idea issue about this: Search field and pagination in pages/files/users field · Issue #1632 · getkirby/kirby · GitHub – please leave your +1 on this issue (thumbs up emoji). It helps us to inform our decisions reagarding the roadmap for Kirby.

1 Like

Done :slight_smile:

May be we need some other field, not only Pages List widget, but something truly other, like Pages Search widget, with no initial list within, but with drop-down titles while searching/typing?

It will cover many things than will need when creating “many-pages” sites. If you need some kind of “predefined” pages list selector, use Pages field widget, if you need to search pages in wide (or global) range of pages, use Pages Search widget…

On the other side, “universal” Pages List + Search widget will be ultimative solution for cases like mine (and I’ve seen 1-2 topics on this forum with needs like this).

Well if you phrase it that way, you could use the multiselect field with option queries: https://getkirby.com/docs/reference/panel/fields/multiselect#dynamic-options

fields:
  category:
    label: Your pages selection
    type: multiselect
    options: query
    query: site.children.published

I’ve think about this, but how it works “inner”? Will it call all 1024 pages before my typing or it will query only if I type something?

It will gather the collection of pages on initialization. Since it sounds a lot like you would like to have, give it a try (blueprint bit isn’t a lot of work) and see how it performs for your specific case.