Collections icon indicating copy to clipboard operation
Collections copied to clipboard

Show collections in collections

Open wax100 opened this issue 7 years ago • 4 comments

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

wax100 avatar Jan 11 '18 07:01 wax100

@theboxer any thoughts on this?

JoshuaLuckers avatar Jun 24 '20 11:06 JoshuaLuckers

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:

image

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?

patrickatwsrn avatar Mar 11 '22 12:03 patrickatwsrn

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 avatar Mar 11 '22 12:03 mindeffects

@mindeffects I like the idea of it being a per-collection setting 👍

pbowyer avatar Aug 28 '22 14:08 pbowyer