Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all.
Using UmbracoCms 8.8.0 and Our.Umbraco.DocTypeGridEditor 1.2.4
How do i get the culture?
Is it possible through the view on the IPublishedElement ?
IPublishedElement
There are som scenarios where i need the culture when i use a Content Picker or Multi Url Picker.
So i created a custom property controller that are used in the grid, inserted with DocTypeGridEditor in the package.manifest like this:
{ "propertyEditors": [ { "alias": "Custom.PropertyEditor.Culture", "name": "Readonly Culture", "icon": "icon-readonly color-red", "editor": { "view": "~/App_Plugins/CustomPlugin/propertyEditors/readonlyCulture/readonlyCulture.html" } } ], "gridEditors": [ { "name": "List", "alias": "Custom.GridEditors.List", "view": "/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.html", "render": "/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditor.cshtml", "icon": "icon-bulleted-list color-green", "config": { "allowedDocTypes": [ "ListView" ], "nameTemplate": "", "enablePreview": true, "overlaySize": "small", "viewPath": "/Views/Partials/DocTypeGridEditor/", "previewViewPath": "/Views/Partials/DocTypeGridEditor/Previews/", "previewCssFilePath": "", "previewJsFilePath": "" } } ], "javascript": [ "~/App_Plugins/CustomPlugin/propertyEditors/readonlyCulture/readonlyCulture.js" ] }
My controller looks like this:
(function () { "use strict"; function readonlyCulture($scope, $routeParams) { $scope.model.value = $routeParams.cculture || $routeParams.mculture; } angular.module("umbraco").controller("Custom.ReadonlyCulture.EditorController", readonlyCulture); })();
There is a $routeParams.mculture and a $routeParams.cculture.
$routeParams.mculture
$routeParams.cculture
When i am editing the main language i am only getting mculture as expected.
And when i change to another language i am getting the cculture as expected.
But when i am using splitview, i get am getting the same result on both documents.
Example:
URL: http://localhost:64556/umbraco/#/content/content/edit/1056?mculture=da-DK&cculture=en-US
Split View: Left -> en-US. Right: da-DK
When i access the grid on both documents i am getting mculture=da-DK and cculture=en-US and can no longer tell the difference, because i do not know which one i am editing.
mculture=da-DK
cculture=en-US
I hope someone know what to do :)
I was told that $scope.model.culture could do it, but not in DTGE. https://our.umbraco.com/forum/using-umbraco-and-getting-started/103020-how-to-get-document-culture-in-controller-to-use-in-grid-when-using-split-view
$scope.model.culture
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to get culture in DocTypeGridEditor
Hi all.
Using UmbracoCms 8.8.0 and Our.Umbraco.DocTypeGridEditor 1.2.4
How do i get the culture?
Is it possible through the view on the
IPublishedElement
?There are som scenarios where i need the culture when i use a Content Picker or Multi Url Picker.
So i created a custom property controller that are used in the grid, inserted with DocTypeGridEditor in the package.manifest like this:
My controller looks like this:
There is a
$routeParams.mculture
and a$routeParams.cculture
.When i am editing the main language i am only getting mculture as expected.
And when i change to another language i am getting the cculture as expected.
But when i am using splitview, i get am getting the same result on both documents.
Example:
URL: http://localhost:64556/umbraco/#/content/content/edit/1056?mculture=da-DK&cculture=en-US
Split View: Left -> en-US. Right: da-DK
When i access the grid on both documents i am getting
mculture=da-DK
andcculture=en-US
and can no longer tell the difference, because i do not know which one i am editing.I hope someone know what to do :)
I was told that
$scope.model.culture
could do it, but not in DTGE. https://our.umbraco.com/forum/using-umbraco-and-getting-started/103020-how-to-get-document-culture-in-controller-to-use-in-grid-when-using-split-viewis working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.