Collections icon indicating copy to clipboard operation
Collections copied to clipboard

Add display of collections in collection grid

Open Ruslan-Aleev opened this issue 1 year ago • 2 comments

Added the ability to display collections within a collection, in a grid.

In the system settings, you can specify collection templates, separated by commas, that will be displayed within the grid.

Before before

After after

https://github.com/modxcms/Collections/issues/369 https://github.com/modxcms/Collections/issues/250

Ruslan-Aleev avatar Oct 01 '24 11:10 Ruslan-Aleev

@Ruslan-Aleev Hey, thank you for the PR, but I'm not 100% sure it's usable as is.

  • I feel like this is something the collection's view should control and not a global system setting
  • Right now they are excluded for a reason, if you hit the "Open" button for collection, the view doesn't change, so if your nested collection has a different view (for example different columns, labels, etc.) the view won't load, just the children will show with the current view. Maybe this could be worked around be either not showing the open button, or making it go to the actual resource instead of loading children to the current view

theboxer avatar Nov 14 '24 16:11 theboxer

@theboxer

  1. Unfortunately, I did not find a way to display collections without using system settings, because there is a database request.
  2. Yes, I did not pay attention to the "Open" button. I did not understand the logic of the "Open" button at all. If the resource is a collection, then it will not be displayed in the grid (this PR fixes this), and if the resource is already in the grid, then a child resource cannot be created for it. Or am I missing something?

In general, I do not know how to fix this PR correctly, maybe you can help. I can make it a draft, should I do it?

Ruslan-Aleev avatar Nov 15 '24 07:11 Ruslan-Aleev