On my parent page blueprint I have a structure field for defining a categories
list.
On the children pages, there is a dropdown with options populated by this structure field. I can get the structure index and the category name value with a query
query:
fetch: site.children.find("parentpage").categories.toStructure
text: "{{ structureItem.cat_name.value }}"
value: "{{ structureItem }}"
On the parent page, in my list of subpages I want to list the category
of each page in the info
property
However info: "{{ page.category }}"
returns me the index in the structure field, since that’s the value saved to the subpage. How can I translate this id to an actual value within the structure?
I’ve tried
info: "{{ page.category.cat_name }}"
and
info: "{{ page.category.cat_name.value }}"
with no luck either
Edit: Figured it out, here’s my query
{{ site.children.find("parentpage").categories.toStructure.find( page.category ).cat_name.value }}
This results in the index of 0
saved on the child page displaying Category 1 Name
on the parent page in the pages
list for the info property