Hey everybody,
I am trying to wrap my head around if it is possible to show values in a structure field that come from another structure field as text.
The scenario is as follows:
In my project I have a list of clients. This is structure 1. Each client has an account Manager responsible. The manager comes from the page managers and ist selected via a query.
The page managers has the list of managers. I want to show besides each manager which client they are responsible for, since they can be responsible for multiple clients.
I have the following blueprints set up:
On site.yml:
clients:
type: structure
label: Clients
fields:
client:
label: Client Name
type: text
manager:
label: Account Manager
type: select
options: query
query:
fetch: site.find("managers").managers.sortBy("name","asc").toStructure
text: "{{ structureItem.name }}"
value: "{{ structureItem.name }}"
and on managers.yml:
managers:
label: Account Managers
type: structure
style: table
sortBy: name
fields:
name:
label: Name
type: text
width: 1/4
email:
label: Email
type: text
width: 1/3
clients:
label: Assigned Clients
type: info
text: >
{{ site.clients.toStructure
.filterBy("manager", item.name)
.pluck("client")
.join(", ")
}}
All I get is all of the clients, without filtering and the rest.
Is that even possible?
Thanks a lot for your help!
Memi