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.
Now using Umbraco 8.11.1 and DocTypeGridEditor 1.2.7 and having trouble getting the right culture.
We use a nestedcontent with a grid inside where we use DocTypeGridEditor to make a Breadcrumb.
This code works in the frontend, but not in the backoffice. Here we are only able to get the main culture.
public class BreadcrumbSurfaceController : DocTypeGridEditorSurfaceController
{
public ActionResult Breadcrumb()
{
var model = new BreadcrumbModel();
var assignedContentItem = Umbraco.AssignedContentItem; // This is for the most part returning unpublished content item with an id that do not exists in the backoffice.
var currentPage = Umbraco.Content(Umbraco.AssignedContentItem.Id);
if (currentPage != null)
{
var culture = currentPage.GetCultureFromDomains(); // This is only returning the main culture in the backoffice
var ancestors = currentPage.Ancestors().Where(x => x.Level > 1);
// Assigning items to the BreadcrumbModel here
}
return CurrentPartialView(model);
}
}
Another issue here is that most of the time Umbraco.AssignedContentItem gives us an unpublished item with an id that do not exists like 1586 and the highest content id we have is like 1281.
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-viewNow using Umbraco 8.11.1 and DocTypeGridEditor 1.2.7 and having trouble getting the right culture.
We use a nestedcontent with a grid inside where we use DocTypeGridEditor to make a Breadcrumb.
This code works in the frontend, but not in the backoffice. Here we are only able to get the main culture.
Another issue here is that most of the time Umbraco.AssignedContentItem gives us an unpublished item with an id that do not exists like 1586 and the highest content id we have is like 1281.
Do anyone got a clue?
is working on a reply...