Thanks guys for yet another great extension, something that again should hopefully make it it into the core one day!
When an editor attempts to sort the items in a grid there is no way to distinguish between one DoctypeGridEditor and another, see the following example:
Is it possible to append the Doctype name to grid editor name?
So, in the example above, the Grid Editor is called Content Block but when sorting it would be useful to say Content Block - Doctype Name.
Disclaimer: I'm not a big fan of using the Umbraco Grid editor for reasons I won't go into here (nothing to do with the controls but the editors) so due to my lack of use I may be missing something obvious?
Someone else asked for this a while back, we looked into it - cutting a long story short, the labels used when sort mode is displayed is handled by the Grid, it uses the "name" that you have for the grid-editor in the grid.editors.config.js. (It's beyond DTGE's control).
the labels used when sort mode is displayed is handled by the Grid, it uses the "name" that you have for the grid-editor in the grid.editors.config.js. (It's beyond DTGE's control).
you beat me to it chris, i was just writing the same thing!
we've this issue in a new editor we're working for in v8. there's loads of rows on the page and it's a nightmare to sort as you've got to remember the item position...
the git hub issue was suggesting using js to change the row title. i did managed to get it almost working using this code in a directive:
$timeout(function () {
//it'd be great to be able to change the title of the grid wrapper as it would make it so much better for sorting
//only problem is, i can't get 'umb-control-title' as when the page loads the element doesnt exist...
//it only seems to come in to play when you click the block
angular.element(document).ready(function () {
var controlInner = element.closest(".umb-control-inner");
var controlBar = controlInner.find(".umb-control-bar");
var controlTitle = controlBar.find(".umb-control-title");
controlTitle.text(scope.name);
});
}, 0);
weirdly though, i can get at controlInner and i can get controlBar but controlTitle always returns null...
i think it's got something to do with the angular not making the controlTitle available until you reorder?
It mostly talks about how to hack the javascript to achieve the result, which is something we wouldn't want to do (as we'd prefer to have support and upgrade ability to future releases intact rather than having a custom version).
It does also mention this:
"My advice is to separate out the grid config entries for each of your doctypes. I know this means you will lose your groupings, but it gives you more control over the naming."
Is there an example somewhere of how to do this? The documentation we have here https://github.com/skttl/umbraco-doc-type-grid-editor/blob/master/docs/developers-guide.md is excellent but doesn't explain exactly how the config\grid.editors.config.js file and the App_Plugins\DocTypeGridEditor\package.manifest interact - as in, which one takes precedence and which one you should use.
We have used the package.manifest option as that is the one documented and seems appropriate, but there is no example of how to add multiple items to the gridEditors array. When we try this, none of the options appear when you go to select your doctype editor in the grid.
I usually add a package.manifest per grid editor. I feel it is easier to manage in git (especially when having multiple devs adding their own editors).
The other way, is to "just" add multiple objects in the gridEditors array of your grid.editors.config.js, or the package.manifest.
Adding the Doctype Name to the Grid Editor When Grid Items are Sorted
Thanks guys for yet another great extension, something that again should hopefully make it it into the core one day!
When an editor attempts to sort the items in a grid there is no way to distinguish between one DoctypeGridEditor and another, see the following example:
Is it possible to append the Doctype name to grid editor name?
So, in the example above, the Grid Editor is called
Content Block
but when sorting it would be useful to sayContent Block - Doctype Name
.Disclaimer: I'm not a big fan of using the Umbraco Grid editor for reasons I won't go into here (nothing to do with the controls but the editors) so due to my lack of use I may be missing something obvious?
Hi Simon,
Someone else asked for this a while back, we looked into it - cutting a long story short, the labels used when sort mode is displayed is handled by the Grid, it uses the "name" that you have for the grid-editor in the
grid.editors.config.js
. (It's beyond DTGE's control).For longer technical details (including hacks), read the ticket on GitHub: https://github.com/umco/umbraco-doc-type-grid-editor/issues/116
Cheers,
- Lee
I thought as much :(
Thanks for the link looks like there could be something useful in there so will see what I can do.
Cheers Lee!
We have this same issue - however this link https://github.com/umco/umbraco-doc-type-grid-editor/issues/116 now returns a 404, is there any way to post the useful information here, or somewhere else we could access it?
you beat me to it chris, i was just writing the same thing!
we've this issue in a new editor we're working for in v8. there's loads of rows on the page and it's a nightmare to sort as you've got to remember the item position...
the git hub issue was suggesting using js to change the row title. i did managed to get it almost working using this code in a directive:
weirdly though, i can get at
controlInner
and i can getcontrolBar
butcontrolTitle
always returns null...i think it's got something to do with the angular not making the
controlTitle
available until you reorder?might give you a starting point though ;)
I found the original link, has moved to the new github repo for the v8 version of DTGE.
https://github.com/skttl/umbraco-doc-type-grid-editor/issues/116
It mostly talks about how to hack the javascript to achieve the result, which is something we wouldn't want to do (as we'd prefer to have support and upgrade ability to future releases intact rather than having a custom version).
It does also mention this:
"My advice is to separate out the grid config entries for each of your doctypes. I know this means you will lose your groupings, but it gives you more control over the naming."
Is there an example somewhere of how to do this? The documentation we have here https://github.com/skttl/umbraco-doc-type-grid-editor/blob/master/docs/developers-guide.md is excellent but doesn't explain exactly how the config\grid.editors.config.js file and the App_Plugins\DocTypeGridEditor\package.manifest interact - as in, which one takes precedence and which one you should use.
We have used the package.manifest option as that is the one documented and seems appropriate, but there is no example of how to add multiple items to the gridEditors array. When we try this, none of the options appear when you go to select your doctype editor in the grid.
Hi Chris
I usually add a package.manifest per grid editor. I feel it is easier to manage in git (especially when having multiple devs adding their own editors).
The other way, is to "just" add multiple objects in the gridEditors array of your grid.editors.config.js, or the package.manifest.
Also, I am working on packaging this little nugget up, to make it easier to manage your DTGEs (video in link)
https://twitter.com/i/status/934006545561653248
is working on a reply...