You can specify in the document type permissions which nodes of a certain template can be created beneath another template. If you browse to your document type, you can view this in the permissions tab.
Node names beneath another node themselves have to be unique. if you have page B, and already have pages named X and Y beneath them, and want to prevent any further nodes from being created, you could hook into a page published event https://our.umbraco.com/documentation/reference/events/contentservice-events/
Check for your parent node, and then check if child nodes X and Y already exist beneath it. If they do, you can prevent the page creation from happening and instead display an error message. Documentation for this method should be described in the above link.
Add Child Node From A Parent Children
I have the following nodes,
A | B | C Z | X | Y
A have 2 child nodes (B and C). Z have 2 child nodes (X and Y).
Now my nodes are dynamic. I wanna make sure B can only have child with name X and Y.
So this will be valid in my case,
But this is not,
So, B can only have Z child's.
You can specify in the document type permissions which nodes of a certain template can be created beneath another template. If you browse to your document type, you can view this in the permissions tab.
Node names beneath another node themselves have to be unique. if you have page B, and already have pages named X and Y beneath them, and want to prevent any further nodes from being created, you could hook into a page published event https://our.umbraco.com/documentation/reference/events/contentservice-events/
Check for your parent node, and then check if child nodes X and Y already exist beneath it. If they do, you can prevent the page creation from happening and instead display an error message. Documentation for this method should be described in the above link.
is working on a reply...