Multiselect query – get both, unpublished AND publish children pages

In a structure field I’m trying to query all children pages from a parent page via a multiselect field. Unfortunately my query only gets the published children pages. Is there a query option to get both, unpublished AND publish children pages?

projekt:
  type: multiselect
  options: query
  query: site.children.template("projekte").children

OR like:

projekt:
    type: multiselect
    options: query
    query: site.children.template("projekte").children.template("projekt")

Thanks for any tips!

Do you mean drafts? Then you need childrenAndDrafts() not children()

1 Like

Ah ok, but this

query: site.children.template("projekte").childrenAndDrafts
instead of this
query: site.children.template("projekte").children

gives me an Invalid query result data. :confused:

This is the status part in the blueprint:

status:
  draft: Unveröffentlicht
  listed: Veröffentlicht

But this query gives you the right results, apart from the fact that drafts are not included?

yes, exactly

:thinking:

Could you please post your page structure? Think I have to test it to see what is happening.

1 Like

Hey, I gave it a second thought and maybe it makes more sense to only show the published items in a multiselect anyways! Otherwise it probably breaks the site. But thanks for the childrenAndDrafts suggestion!