Admin 'override' for insert options #17759
Replies: 6 comments 3 replies
-
The API (at least in v13 and before) doesn't prevent you from adding nodes of disallowed content types where you need it. So you might be able to make a simple extension for Umbraco, that could add a menu item for "admin create node". If you notice the url when creating a new node, you can see the different parts that make it up: Notice the doctype parameter. You can put in whatever content type alias you want to create, and nothing prevents you from doing that. So if you can solve the UI part in an extension, you've got yourself a nifty little package, that other people might find handy :) |
Beta Was this translation helpful? Give feedback.
-
Just tried in v15 - and you while the url seems to allow for the same manipulation (although with guids instead of aliases), the API now seems to prevent you from creating disallowed content types. |
Beta Was this translation helpful? Give feedback.
-
In v13 you could use create a notificationhandler for this : https://docs.umbraco.com/umbraco-cms/13.latest/reference/notifications/sendingallowedchildrennotifications This is still found in the docs for V14 and V15 but if I am correct this has been removed from Umbraco. Don't know what the alternative is in the new backoffice |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@rsoeteman I've made extensive use of your example, we have implemented easy ways to restrict nodes to an x number of child nodes of a certain type below a parent and disallow delete of certain nodes, unless you are an admin (and I changed the menu option so it's clear when you are an admin that you aren't really supposed to delete the node). Creating an additional menu to override insert options (I should call it permissions in Umbraco) isn't that hard. But if it doesn't work in Umbraco14+, I'm not gonna bother. I also hope that there is an alternative to the SendingAllowedChildrenNotification, because I'm about to update our core packages to Umbraco 15. That would break all that functionality... |
Beta Was this translation helpful? Give feedback.
-
Just to crosslink this back to the chat on Discord around And the link if you're already on Discord and want to talk more there: https://discord.com/channels/869656431308189746/1238039395748020275 |
Beta Was this translation helpful? Give feedback.
-
Sometimes you just need to have a node of a certain type one time and you don't want anyone else to create it. Lets take a 404 page below a homepage node as an example.
So now I need to add the 404 document type to the homepage as a valid insert option, create tot 404 page in content and then remove the 404 page from the homepage again. In Sitecore (ew, dirty word!), you can ALWAYS override the insert options and practically create any document type anywhere in the tree.
(Yes, a 'template' in Sitecore is a content type in Umbraco)
And although I don't miss Sitecore at all, this is a small feature that's really nice to have as an administrator.
Beta Was this translation helpful? Give feedback.
All reactions