I’m building a custom property editor that needs to fetch options from an API, but the options depend on the editor’s parent node in the content tree. The content structure looks roughly like this:
Container/
└── Subject1
└── Series1
└── Primary1
├── Secondary1
├── Secondary2
└── Secondary3
So, for example:
- Secondary1 should be aware of the ID of Primary1
- Primary1 should know about Series1, and so on.
The challenge is: what’s the correct context or method to access this parent ID when the property editor lives inside a Block Grid block?
What I’ve Tried
- Browsing available contexts using
<umb-debug visible dialog></umb-debug>
— helpful in some cases, but mostly inconclusive inside blocks. - Accessing
UMB_DOCUMENT_WORKSPACE_CONTEXT
— this sometimes provides useful data, but often doesn’t include the parent ID, even when the property editor is placed directly on a document.
Current Workaround (A Bit of a Somersault)
I’m starting to think that the browser URL is actually the most reliable place to extract the current document ID. It’s not exactly elegant—it feels like doing frontend somersaults just to grab something that should be one step away—but at least it’s consistent (I think?).
Is there a cleaner way?