Reference other property editors
# package-development
b
I talked to a few people at DK festival, and promised @Sebastiaan to ask it here as well. If I have a custom property editor, which value depends on other properties, how do i reference those properties? I have a some examples of this, like getting a color palette from an image, summarising body text into a meta description with AI or the video poster i posted to #905057811682193429 a few weeks ago, In the video poster, i got i working with some (very) ugly dom manipulation, but I'd like to know the "proper" way to do it
message has been deleted
n
Interesting, so this was only posible via the DOM in previous versions but from v.14 you can access the other properties values via the so called PROPERTY_DATASET_CONTEXT. But this would just give you the value, which does not give you this UX. But you could take the value and open a modal where the user then could pick which frame they like to capture? So maybe thats an idea? Cause we do not provide anything for you to get in contact with the other Property Editor element. As well we cannot guarantee that another Property's Property Editor is rendered. Like if it was placed on another tab etc. As well such binding forces one of the property editors to be tightly coupled to the other. So the above idea would be my suggestion on this. This documentation article describes how to use the Dataset to retrieve and/or observe values from other properties. https://docs.umbraco.com/umbraco-cms/customizing/property-editors/property-dataset#consume-values
Good luck, and let us see the result, thanks 😄
b
Thanks Niels! I got it working with Dataset Context, and now have a working Color Thief implementation. It sounds like the right way to do it without dom manipulation, and being dependent on stuff happening inside other editors https://cdn.discordapp.com/attachments/1311264909438484520/1311653659029012531/Skrmbillede_2024-11-28_kl._12.20.33.png?ex=6749a429&is=674852a9&hm=faac5c8040d8bedaf83b4ba80b33e01ac7129edb05a94d54aacdea608c075873&
2 Views