Collections
Collections copied to clipboard
Add display of collections in collection grid
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
After
https://github.com/modxcms/Collections/issues/369 https://github.com/modxcms/Collections/issues/250
@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
- Unfortunately, I did not find a way to display collections without using system settings, because there is a database request.
- 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?