We have moved to GitHub Issues
Created by Michael Nielsen 15 Feb 2016, 09:49:48 Updated by Laurence Gillian 25 Oct 2017, 16:56:04
Relates to: U4-8316
The sort order of the Grid Editors seems to be alphabetic, and not in the order that is chosen in the Grid Editors tree in Developer section.
I can reproduce.
Hi Claus, we are going to close this issue because we feel that sorting the grid editors based on alphanumeric sorting is consistent throughout the back office and for most users this makes sense and is also automatic.
The other problem which @Shandem pointed out is that there's not one single source of config where grid editors are stored, people can store them in their own
App_Plugins folder, so it's impossible to know what to sort first. I'll make a feature request for making them sortable when you pick them on the datatype editor.
Alphanumeric ordering is not the appropriate way of ordering of grid editors. The right way would have the most important grid editors (RTE, Image) on top of the itempicker. As far as I can see, up to v. 7.3.x the grid editors were sorted in the order they appeared in the grid.editors.config.js. That gave us the possibility to sort them. The itempicker introduced the ordering by name with 7.4.
As a workaround I removed the orderBy:'name' expression in line 16 of itempicker.html:
ng-repeat="availableItem in model.availableItems | compareArrays:model.selectedItems:'alias' | filter:searchTerm"
But I'd appreciate a more generic way of sorting... The LeBlender Plug-in provides an own tree for the grid editors in the developer section and allows sorting the editors, which changes their order in the grid.editors.config.js. That might be easier to accomplish than sorting in the datatype editor.
But again, a main problem is that custom grid editors should not belong in the grid.editors.config.js file - this is a core shipped file and although you can change it, it is not recommended because we may need to ship with a new one. The correct way to add custom grid editors is through the package manifest found in App_Plugins (see: https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/grid-layout/build-your-own-editor). Since there can be many files containing grid editors, in order to make a custom sorted list of all of them, this sorted list or the sorting info would have to be persisted to some new place which doesn't exist.
Thanks, Shannon, for pointing this out. If a new version of Umbraco rolls out, we have to merge all config files anyway. For me it wouldn't matter if there were one more file to merge. We are using LeBlender and this tool stores new custom editors in the grid.editors.config.js.
How about asking the authors of LeBlender, if they allow to incorporate that tool into the core. It has a UI for managing and sorting the editors. If you really need to separate custom editors from core editors, it wouldn't be much of a problem to store the custom editors in a separate file, let's say in custom-grid-editors.config.js or whatever. The core editors could be merged into that file automatically and that would give us the possibility to have them all at one place and sort and manage them according our taste.
If you come to a decision in the HQ, which way you want to go, we'd be glad to help realizing it.
@Shandem just wondering if we could first look for a config item called 'sortOrder' and if not set then sort by name: eg
ng-repeat="availableItem in model.availableItems | compareArrays:model.selectedItems:'alias' | orderBy:['config.sortOrder', 'name'] | filter:searchTerm"
this would still involve people tweaking the config file/custom property manifest files, if they needed to change the order, but if the sortOrder wasn't set then it would just be alphabetical as it currently is...
... but really you want to be able to order the grid editors differently on a cell by cell basis, so the most popular editors for a particular cell in a particular row are displayed more conveniently, so it seems natural to the editor, and they aren't aware they are having to think and make a selection... (but that's hideously complicated to implement, so I will shut up about it)...
Rather than worrying about the sort order, why not provide a grouping like Archetype provides?
Hmmm! It really should not assumed that these editors should be sorted alphabetically, they should be sorted in a way that is most convenient to the content editor. This really starts to become an issue when you have more than 9 Grid Editors. In most cases, it makes sense to sort by a lose Hierarchy (e.g. H1, H2, H3, Richtext, Images, Videos)
I would propose the following:
In the future this could be further improved:
I guess it's a pain! But, the content editing experience of alphabetical sorting is not good, and more and more people are adopting Grids in their websites.
Re: grid.editors.config.js file, if this file is not intended to be edited, should we not ship with an additional file / create an additional file, for when edits are made?
Backwards Compatible: True
Affected versions: 7.4.0
Due in version: