I have a
tag field inside a
structure field. I’d like to autocomplete this field by querying all of the other pages. I’ve done this successfully many times with tags, but never from inside a
query: page.parent.childrenAndDrafts.pluck("kiez", ",", true)
This does not work. How do I get the query to look inside the structure field?
I think you need a custom method to achieve this, pluck only works with single value fields or fields with comma etc. separated values.
I tried calling a custom site method which returns an array, but that didn’t work. like
query: site.getItems where
getItems basically is like:
$array = $this->someField()->yaml();
return A::pluck($array, ‚tags‘);
(Strange apostrophes due to me typing on iOS)
Did it much like you described here …
That should actually work, what is your Kirby version? And what’s in your blueprint?
Well, oddly it does now … Guess it was restarting PHP that must’ve worked