Copied to clipboard

Flag this post as spam?

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


  • Mateusz Kotwica 31 posts 131 karma points
    Aug 16, 2023 @ 13:42
    Mateusz Kotwica
    0

    [Backoffice/Angular] Accessing "sibling" properties

    Hello Everybody!

    I am trying to build generic logic to be able to read all the properties from current level of the document starting from root node or nested content/block list item.

    It is quite easy to achieve at the main document level, as I can use editorState.current to read all the properties. But the case is more complicated when I am trying to achieve the same goal starting from a block in the block list.

    To clarify the case, let's consider following structure:

    Root
       Prop0::CustomPropertyReader
       Prop1::string
       Prop2::int
       Prop3::BlockList
          BlockItem1
             Prop3-0::CustomPropertyReader
             Prop3-1::DropDown
             Prop3-2::Image
    

    I would to be able to see in my CustomPropertyReader following values:

    Prop0: {prop0, prop1, prop2, prop3}
    Prop3-0: {prop3-0, prop3-1, prop3-2}
    

    Has anybody done something similar before or know how to do it?

  • Mateusz Kotwica 31 posts 131 karma points
    Aug 16, 2023 @ 20:23
    Mateusz Kotwica
    100

    In case anyone is looking for an answer in the future: this is possible by traversing up the scopes chain.

Please Sign in or register to post replies

Write your reply to:

Draft