I want to filter a structure field based on the ID of a page selected from one of the pages contained in the structure. The query should work like this:
In this case, chesas is the pages field that returns a page. Slug is dynamic, based on the route. The page is a child of another page (query: 'page("projects").children').
Is it possible to filter by the page content (in my case, its ID)?
Ok I see… Many thanks for your reply. ${slug} is the route f.ex. /projects/subpage and equivalent to the page.id.
I use it to dynamically fetch the content:
query: `site.page("${slug}")`,
…and since parts of the data comes from other pages i would like to fetch just this certain data in the structure field. (instead of fetching the whole structure data and then filter the collection using JS)