I use a structure section with two levels, parents and children. Is it possible to show related entries of a parent, where only a child of that parent is selected as a related entry?
I did try to solve it like this:
{% set children = entry.children().all() %}
{% set relatedEntries = craft.entries.section('news').relatedTo(children).limit(3)%}
But parents now show all entries, not only the entries that are related to (one of) their children.
I would like to create something like this:
**Structure:**
Parent1
-> Child11
-> Child12
-> Child13
Parent2
-> Child21
-> Child22
**News entry**
-> News1 with related entry Child11
**In the Parent template**
News1 is related to Parent1
entry
variable in your code is the parent? And what are the children related to, in which field? On the parent or the child?