remove some Document Type and Media Type from the DropDownList after Create
Hi everybody,
In the content or media tree, when you create a new node, a popup window allows you to choose the document/media type for the child among the allowed children. But when the context node is the tree, the dropdownlist shows the entire list of document type / media type. Is it possible to remove some of them trough the ApplicationBase ? How ?
I guess I have to work on event
Media.New += new Media.NewEventHandler(Media_New);
if (sender.Level == -1) { // I can not figure out how to accees the listItem of the rendered DropDownList }
}
Check this screenshot (right-click > Create on the "Content" node): from these DocumentType, only 3 can be created right below "content", the remainings items are only children of other document types
remove some Document Type and Media Type from the DropDownList after Create
Hi everybody,
In the content or media tree, when you create a new node, a popup window allows you to choose the document/media type for the child among the allowed children. But when the context node is the tree, the dropdownlist shows the entire list of document type / media type. Is it possible to remove some of them trough the ApplicationBase ? How ?
I guess I have to work on event
Media.New += new Media.NewEventHandler(Media_New);
void Media_New(Media sender, umbraco.cms.businesslogic.NewEventArgs e)
{
if (sender.Level == -1)
{
// I can not figure out how to accees the listItem of the rendered DropDownList
}
}
Check this screenshot (right-click > Create on the "Content" node): from these DocumentType, only 3 can be created right below "content", the remainings items are only children of other document types
Can anyone help ? Thanks in advance.
I don't believe that you can remove items from the dropdown list using the Media.New event.
However, using your existing code you could check the document type that is being created and return false if you do not want the user to create it.
It's not the most elegant way but it would prevent the user from creating those documents.
is working on a reply...