Query Syntax: "Or" fallback

I’m trying to fetch the first image of a child page if the cover field of the current page is empty,
but it doesn’t work. Is it possible to use the or fallback in Query Syntax?

  label: Projekte
  type: pages
  query: page("projects").children
    query: page.cover.tofile.or(page.children.images.first)
    cover: true

or() is a field method, so you cannot use it with a null/a file object. I’d use a custom page method or model.

1 Like

Oops, You’re right…
Ok, thank You, that will work! :relaxed: