This code works if my property editor is on the content node however it doesnt work if I am in the slide out panel. I thought adding .passContextAliasMatches() would resolve this however no luck.
This one is properly first available in 17.2, but we introduced a new VariantId that you may need in your case; this one is relevant in the case of mixing ariant and invariant Blocks.
Cause when writting a invariant block, the variant id would have a null culture. But you may want to know the culture that the data is stored for, then you can use this:
Hi @marc_love, so then you’re in the same case as the reason for introducing the displayVariantId.
Please await 17.2 then.
The alternative here and now ‘hack’ would be to consume UMB_CONTENT_PROPERTY_DATASET_CONTEXT with .passContextAliasMatches() so you’re not blocked by the first property dataset it meets.
This will give you the variantId of the picked variant in the variant-selector.
But notice this will work well in Global Blocks, and there might be other future features that will ruin this. So again from 17.2 please use the UMB_VARIANT_CONTEXT as this is decoupled from the Block to belong on a Content(Document/Media/Member)