Hey!
I am making a blueprint snippet where there’s a page field selecting from a specific template. I would like to make an option to switch between searching the children of the current page, or the entire site.
Two different queries I would like to be able to switch between:
query: page.children.filterBy('template', 'in', ['artifact'])
query: site.index.filterBy('template', 'in', ['artifact'])
I was thinking of implementing this using a simple toggle field, but I am not sure if this is easily done the only solution I could find so far would be similar to the link below, which might be a bit much for what I am looking for: Programmatically change the content of the file field
Another option would be if it’s possible to switch between page.children and site.index through some way, or less clean solutions like duplicating the field and displaying the non-empty one through PHP or duplicating the entire block.
I would love to hear if you have any good suggestions for this!