Custom Label Property Editor

I am in the process of creating a custom property editor in V16. Is it possible to expose the description entered against the property on the Document type?

In V13 you could access it via model.description in your view. In V16 I cant see the property anywhere.

Anyone know if this is possible?

Yes, I believe you need to UMB_PROPERTY_CONTEXT and that should give you what you need.

this.consumeContext(UMB_PROPERTY_CONTEXT, (context) => {
  this.observe(context.description, (description) => {
    console.log('Description changed to ' + description)
  })
})

You also have access to context.label and other goodies. See more here:

Thanks @jacob that worked with the addition of the following around the observe:

if (context?.description) {}

One other thing. In V13 you could choose to hide the label when defining a new property editor within the package manifest file. Can this still be done in V16?

ā€œhideLabelā€: true

No, not as far as I’m aware. That is also one of the things you could do with the SendingContentNotification, so it might be something to look into adding again. The discussion for those ā€˜missing’ features is here:

I would say that SendingContentNotification was for more advanced customisations of the backoffice depending on certain conditions. Hiding the label on a property editor should still be an option. We use it for a custom label property editor that we use to display instructions to the editors.

It would be nice to still be able to do this. Is there any other way this could be achieved with the currently released code?

It needs to be a UI option, which is why it is not currently possible. We are still in the process of trying to map and process all previous ā€œsecretā€ options and use-cases you had from notifications and undocumented options.

Well… I cannot fully endorse this, but your screenshot resembles Editor Notes from Contentment, and it seems Lee has found a way on his 6.x branch:

Which is then used in the Editor Notes component: umbraco-contentment/src/Umbraco.Community.Contentment.Client/src/property-editor-ui/editor-notes/editor-notes.element.ts at dev/v6.x Ā· leekelleher/umbraco-contentment Ā· GitHub

Ahhhhhh, okay. Still interesting to see hacks :grinning_face: . Love the comment!!!

Thanks for this :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.