3
votes
Accepted
Excluding entries in an entry query with an array of IDs (PHP)
The implode function will turn the array of IDs into a comma-separated string. Then you're putting that into an array with 'not' as the first element, so the parameter you're passing to id() looks ...
2
votes
Accepted
Get children of multiple entries
There's a method available to all element queries called getDescendants() (or like any method in Yii you can omit the get prefix and use descendants()):
{% for child in craft.entries.id([4,35])....
1
vote
Get children of multiple entries
Why don't you get the children from each entry individually and then merge them together like so:
{% set childrenOne = craft.entries.id(entryID).one().children.all() %}
{% set childrenTwo = craft....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
elementquery × 73craft3 × 21
query × 17
entries × 10
templating × 8
plugin-development × 6
relations × 6
matrix × 5
plugin-elementapi × 5
php × 4
categories × 3
cache × 3
relatedto × 3
elementtype × 3
users × 2
entry × 2
field × 2
structure × 2
datetime × 2
elementcriteriamodel × 2
custom-fieldtype × 2
array × 2
ordering × 2
entrymodel × 2
yii × 2