Pages Field Search Uses Page Title Instead of "text" Parameter

Hello,

The pages field allows customizing what title is shown to the user when selecting pages by setting a “text” value in the blueprint (instead of showing the page title, you can show something else).

However the search bar at the top seems to still use the page title instead of what has now been set in the “text” field, which is very counterintuitive.

Here is a demonstration:
https://capture.dropbox.com/mdquu57fdD3QPk0d

Is there any way to override this so that the search bar uses what has been set in the “text” field?

Thank you!

Which Kirby version are you using? I tested with 3.6 and cannot reproduce your issue.

Hi Sonja! Thank you for your reply and for looking into it – I hadn’t considered that this could possibly be a bug 🥸

I am using Kirby 3.6 as well. Here’s some more information.

Here is the blueprint:

type: pages
label: Enable
query: page.elements
text: "{{ page.matrix }}"
info: "{{ page.matrixTitle }}"
subpages: false

The “text” field in the field blueprint is set to a page model function, i.e. where “matrix” is a public function across multiple page models.

The “query” setting is being provided by page method (as described in this solution). The page method is returning a set of pages of multiple template types, in case that could be relevant.

I have also attached a second recording where I am searching based on parameters present in the “info” field, and that seems to work:
https://capture.dropbox.com/B5QVynNKmkZBVFXz

So could it be possible that this has something to do with:

  • The use of a page model for the “text” field in the blueprint, or
  • Something about the search function itself

Thank you!

@texnixe Any idea if this was confirmed as a bug or any tips to investigate? I generally haven’t fiddled/overriden existing Kirby fields :crazy_face:

For anyone who stumbles upon this looking for a temporary solution, the way I addressed this is to use a page update hook to store the “page.matrix” value referenced above in the page itself, so that the search picks it up.