Collections
Collections copied to clipboard
Show collections in collections
Make a setting , that allowto show Collections in Collections.
Now we can make it by commenting line 325 in
core/components/collections/processors/mgr/resource/getlist.class.php
'class_key:!=' => 'CollectionContainer',
But better if there will be a setting in Container resource
@theboxer any thoughts on this?
Deactivating line 354 still solves the problem,
$c->where(array(
//'class_key:!=' => 'CollectionContainer',
// "NOT EXISTS (SELECT 1 FROM {$this->modx->getTableName('modResource')} r WHERE r.parent = modResource.id)"
));
Result:

Question: https://docs.modx.com/current/en/extras/collections/index#collections-templates-new-in-version-2 says this about sub collections
Just like the MODX Resource Tree itself, Collections supports nesting. You can create a Collection within another Collection. Sub Collection Containers will be displayed in the resource tree and their children will be displayed in the grid view.
From my point of view this line is a contradiction to this statement. Whats the purpose of this where condition?
Being able to nest collections is an importat feature and was promoted as such: "Just like the MODX Resource Tree itself, Collections supports nesting. You can create a Collection within another Collection. Sub Collection Containers will be displayed in the resource tree and their children will be displayed in the grid view."
The line "#354 hack" just commenting the code out works – until the next update. ;-)
Why not put the "hack" inside the code?
Or is there any situation when the code is really nedded? If "yes" it really should be a setting – with "allow nesting" being set to true by default.
Your opinions on this?
@mindeffects I like the idea of it being a per-collection setting 👍