Can pages select field be searched?


#1

Hello.

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

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:


#2

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

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


#3

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:


#4

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.


#5

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…


#6

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.


#7

To your initial questions: No, this is currently not possible. However, there is an idea issue about this: https://github.com/getkirby/ideas/issues/202 – please leave your +1 on this issue (thumbs up emoji). It helps us to inform our decisions reagarding the roadmap for Kirby.


#8

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…


#9

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).


#10

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

#11

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?


#12

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.