How to filter Select field by template?

Hi all,

I’m wondering if there’s an easy way to extend the panel’s Select field to filter pages by template?

Ideally I’d be able to add a filter under the query portion of the blueprint markup, like so:

fields:
  relatedpost:
    label: Related post
    type: select
    options: query
    query: 
      page: blog
      fetch: pages
      filter:
          field: template
          value: blogpost
      flip: true

I tried taking a look through the existing file in /panel/app/fields/select/select.php, but I’m more of a front-end guy and didn’t see an obvious place to stick a filterBy('template','blogpost')

Any help would be greatly appreciated!

Looking at the code, the following might work already:

    query: 
      page: blog
      fetch: pages
      template: blogpost
      flip: true

This works! Thanks so much, the documentation was a little hard to follow but looking at your example code it does make sense now.