johannschopplich/kirby-blurry-placeholder

Get placeholder data via API/KQL

Closed this issue · 1 comments

Is there any chance to use Kirby Query Language to get placeholder data?

I tried the following — It was a desperate shot in the dark and with no success :-)

...
photo: {
  query: "page.photos.toFiles.first",
  select: {
    url: true,
    placeholderUri: true,
    focus: true
  }
}

Maybe that's more of a KQL-Question on how to call fieldMethods in a query...

I have added support for KQL. Glad you asked!

Usage should work as shown below. The placeholder and placeholderUri file methods are now accessible via KQL:

photo: {
  query: "page.photos.toFiles.first",
  select: {
    url: true,
    hash: "file.placeholderUri",
    focus: true
  }
}