Query for Select with value of site-blueprint

dear forum,

in my blueprint i am trying to fetch the children of a specific page for my select.
the parent page of these children should be dynamic so my idea was to put a select field in the site.yaml and then use this value in my query:

site.yml:

containerpage:
  label: Containerpage
  type:  select
  options: query
  query: site.children

mypage.yml:

relatedpage:
  label: Related Page
  type:  select
  options: query
  query: site.find( {{ site.containerpage }} ).children

however this does not work. i managed to get the functionality i want via a siteMethod in a plugin, however that kinda felt like shooting cannons at sparrows so i am curious if there is in fact a smoother way to do it?:slight_smile:

Try

query: site.find(site.containerpage.toPage()).children

You need to create a page object from the select field value. Why don’t you use a pages field instead of the select?

1 Like