https://discord.umbraco.com logo
I have a V13 package that does some
# package-development
i
I have a V13 package that does some funky things with Forms in the backoffice. Admin's are able to "LOCK" a form once its been designed, so that additional changes can't be added. Part of this plugin also amended the Tree section and changed the icon / added [LOCKED] at the start of the node name (see attachment). After upgrading to V17, we've lost the TreeNodesRenderingNotification handler. What would be the best way of implementing this now? https://cdn.discordapp.com/attachments/882984798719729704/1498995251447074826/Screenshot_2026-04-29_at_11.27.21.png?ex=69f32f9d&is=69f1de1d&hm=dac589d611bdb52db855c8785d6d397a7e0da001cb907dba634b0b17edbbb291&
w
I would consider an Entity Sign to show its locked https://docs.umbraco.com/umbraco-cms/customizing/signs
I would check & investigate to see if there is a nice Forms Workspace Context where you could set a readOnlyGuard or similar like for a document https://docs.umbraco.com/umbraco-cms/customizing/property-level-ui-permissions
Use @rockerby Umbraco Chrome Extension to help see what context & its properties are available when you are viewing/editing a form - as you may be able to mark it as readonly
Hope that helps give you some ideas/pointers @Ian Houghton
i
your a star @Warren Buckley there's so much new stuff to learn with V17, the hardest part is finding it in the docs 🤣
w
No worries - but yeh loads of thiongs to think about. Need to try and think clientside first rather than the older approaches of being able to edit the UI easily from C# at runtime. The client needs to make a request to a MGMT API to know about this state of forms at some point
Feel free to look at ContentLock package I done for some pointers or ideas that may inspire you
w
Nice how did you end up solving it?
i
I created: 1) entitysign to handle the icon switching, and updating of the node name 2) custom condition IsLocked to handle the check if the form is locked/published via an API 3) custom workspace for the Read Only view showing the locked symbol and text, and some code that adds the reverse of IsLocked to the default Design view to hide it
w
Future suggestion - perhaps disable/remove the save button for the form bottom right
Interesting you replaced the entire icon with the entitySign as thought that was just a icon overlayed on the original and had no hook to update the node name in the tree
i
that's a good idea 👍
r
Thanks for the mention @Warren Buckley ! did you end up using the tool in the end @Ian Houghton ?
3 Views