that won’t work because the query language doesn’t support evaluating function arguments.
Your query is automatically converted to the equivalent of:
site.find("releases").children.getRecords("page")
(page is simply seen as a string and not as a variable pointing to your artist)
There are many ways to work around this.
I guess the cleanest and most expressive one would be to create a page model for your “artist” pages.
That would go like this:
/site/models/artist.php:
<?php
use Kirby\Cms\Page;
class ArtistPage extends Page {
function getRecords($recordsId) {
return site()->find($recordsId)->children()->getRecords($this);
}
}
you would use it in your artist.yml like this:
sections:
releases:
headline: Releases
type: pagesdisplay
query: page.getRecords("releases")
If you only ever will have a single page that collects all records (and that one will never change uid), you might as well hardcode the path to it:
<?php
use Kirby\Cms\Page;
class ArtistPage extends Page {
function getRecords() {
return site()->find('releases')->children()->getRecords($this);
}
}
and then simply use it as query like this:
query: page.getRecords
you can of course use that function also in your artist template ($page->getRecords())
PS: I haven’t tried any of that code.