Deb
Deb

Reputation: 401

Can we restrict creating child items for any specific template?

I have 2 templates Template 1 and Template 2. Template 2 is the child of Template 1 and Template 1 is going to be the parent one. But the requirement is to disable creating any items under item derived from child template. When we right-click on Item I want to disable "Insert From Template" option for this specific child template only. If I alter the core database to remove "Insert From Template" it would be applied to all items which is not required.

Is there any other way or suggestions that can help me here?

Upvotes: 1

Views: 733

Answers (1)

Paul
Paul

Reputation: 1403

You could probably restrict the creation by extending the item:created event. Here's an example: Sitecore Insert rules to ensure at most (1) children of a certain type. The idea is, you display a message in the UI if the user tries to create an item under an item of a certain type.

It may also be possible to do it with insert rules, but you might not be able to remove the Insert from Template option itself. For more info on insert rules, check out part 5.4 (page 35) of the data definition cookbook: https://sdn.sitecore.net/upload/sitecore6/60/data_definition_cookbook_sc62-a4.pdf.

Upvotes: 1

Related Questions