Getting current node's culture in custom property editor
Hey there beautiful people!
I'm building a custom property editor that fetches some info from a "repository" with culture variant node children.
The issue is: the content I'll get from that children will depend on the culture I am in the document I'm editing.
i.e.:
i'm editing the document with "pt" culture so I'll get the "pt" culture variant of that repo's children. If i'm editing the document with "en-US" culture, I'll get the "en-US" culture variant of the repo's children. Does this make sense?
Anyway, I have the query strings cculture and mculture which give me the Current Culture (cculture) and the Main Culture (mculture), but when I'm editing in split view, I don't know which culture was opened in split view.
So I was thinking there must be a for-sure way to know, in the controller.js, the culture I'm currently editing but I can't seem to find anything.
The editorState.current has a property variants that holds the variants of the document being created. Each variant even has a property active which indicates whether that is the language we are editing or not so I can use it to get the culture in the request.
There's still, however, one issue remaining: when using Split View.
When using Split View both variants are active and there's a single call to the angular controller.js so I cannot display different results for the different variants...
Is this not accomplishable at all or am I'm missing something here, in the html view, for instance?
Getting current node's culture in custom property editor
Hey there beautiful people!
I'm building a custom property editor that fetches some info from a "repository" with culture variant node children.
The issue is: the content I'll get from that children will depend on the culture I am in the document I'm editing.
i.e.:
i'm editing the document with "pt" culture so I'll get the "pt" culture variant of that repo's children. If i'm editing the document with "en-US" culture, I'll get the "en-US" culture variant of the repo's children. Does this make sense?
Anyway, I have the query strings cculture and mculture which give me the Current Culture (cculture) and the Main Culture (mculture), but when I'm editing in split view, I don't know which culture was opened in split view.
So I was thinking there must be a for-sure way to know, in the controller.js, the culture I'm currently editing but I can't seem to find anything.
Has anyone face some similar issue?
Thank you guys and gals!
Little update.
The
editorState.current
has a propertyvariants
that holds the variants of the document being created. Each variant even has a propertyactive
which indicates whether that is the language we are editing or not so I can use it to get the culture in the request.There's still, however, one issue remaining: when using Split View.
When using Split View both variants are active and there's a single call to the angular controller.js so I cannot display different results for the different variants...
Is this not accomplishable at all or am I'm missing something here, in the html view, for instance?
Any thoughts on this?
is working on a reply...