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.
I'm on Umbraco 8.8.0, if that makes a difference, and it works both when changing the editor language and opening split view in my experience, and I tested it with the contentResource like this:
I have to tell you, I stumbled upon your question having the same problem with split view, and I thought I had finally found the solution, and I was very distraught that no one had answered you yet. So I dived into the angular.directives.js file of Umbraco to try and see how the variant editors work, and I got lucky!
How to get document culture in controller to use in grid when using split view
Hi all.
How do i get the document i am currently editing culture in an angular property controller?
I have 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 :)
Hello!
First things first, the answer is:
I'm on Umbraco 8.8.0, if that makes a difference, and it works both when changing the editor language and opening split view in my experience, and I tested it with the contentResource like this:
I have to tell you, I stumbled upon your question having the same problem with split view, and I thought I had finally found the solution, and I was very distraught that no one had answered you yet. So I dived into the angular.directives.js file of Umbraco to try and see how the variant editors work, and I got lucky!
Hi Jacob.
Thank you for your reply.
I will test it out tomorrow.
In version 8.7.0 the $scope.model.culture is always null.
The property exists but is just null.
I am gonna try to upgrade to 8.8.0 now and see if it changes anything.
I now upgraded to 8.8.0 and the
$scope.model.culture
is still null.Its because i use it in a property inside a DocTypeGridEditor element in the Grid.
When i use it on a property directly on the document it works.
Hi, that could be a bug with DTGE, I suppose. I tested it in a standard grid editor controller.
Does it work in your property editor outside of DTGE?
Yes it works directly on a property.
So i asked the same question to DTGE here https://our.umbraco.com/packages/backoffice-extensions/doc-type-grid-editor/doc-type-grid-editor-feedback//103967-how-to-get-culture-in-doctypegrideditor
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.