Hello,
I need to get the children of children in the Panel for a Select Field.
So my question: How can I get the children of a folder with a dynamic UID?
My Setup:
- static-uid-maincategory/
- static-uid-subcategory/
- dynamic-uids-first/
- dynamic-uid-items-first
- dynamic-uid-items-second
- dynamic-uid-items-third
- dynamic-uids-second/
- dynamic-uid-items-first
- dynamic-uid-items-second
At the moment I can only get the “dynamic-uids-first” and “dynamic-uids-second” as they are children of a folder with a static UID.
texnixe
2
You can use $page->grandchildren()
or in this case page('static-uid-maincategory/static-uid-subcategory')->grandchildren()
How exactly would I do this in my blueprint?
query:
page: static-uid-maincategory/static-uid-subcategory
fetch: page->grandchildren
value: '{{title}}'
text: '{{title}}'
flip: true
texnixe
4
Oops, the grandchildren option does not seem to exist for blueprints…
Edit: Maybe you can fetch all pages and filter by template, if your grandchildren have a unique template, like this:
category:
label: Category
type: select
options: query
query:
fetch: pages
template: dynamic-uid-items-template
3 Likes
That’s it! Thank you so much!