Query for owners of other elements #17657
Replies: 2 comments 1 reply
-
+1, I need this at the moment! One point regarding the syntax, I would've expected to be able to query by the name of the property – e.g.: {% set bendAddresses = craft.addresses().locality('Bend').ids() %}
{% set bendUsers = craft.users().addresses(bendAddresses).all() %} But using |
Beta Was this translation helpful? Give feedback.
-
Ok—I'm realizing now that this behavior does exist, but only for nested elements owned via custom fields. Both the Matrix field ( In this example, {% set bendAddressIds = craft.addresses().locality('Bend').ids() %}
{% set bendStores = craft.entries()
.storeAddress(bendAddressIds)
.all() %} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Like
relatedTo()
andowner()
/ownerId()
params, it would be handy to be able to look up the owners of a set of elements:Currently, you have to do a bit of juggling:
Similar in nature to #15790
Beta Was this translation helpful? Give feedback.
All reactions