Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pedro Mendes 53 posts 258 karma points
    Dec 21, 2022 @ 17:15
    Pedro Mendes
    0

    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!

  • Pedro Mendes 53 posts 258 karma points
    Dec 21, 2022 @ 18:35
    Pedro Mendes
    0

    Little update.

    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?

  • Pedro Mendes 53 posts 258 karma points
    Dec 28, 2022 @ 01:53
    Pedro Mendes
    0

    Any thoughts on this?

Please Sign in or register to post replies

Write your reply to:

Draft