NOTE: For Umbraco v10/v13, use the Discipline package:
https://marketplace.umbraco.com/package/dotsee.discipline
which provides the functionality of the AutoNode, NodeRestrict, VirtualNodes, and VariantsHider packages together.
This is a simple plugin that automatically creates new child nodes in the Umbraco back end upon publishing a node, based on a set of user-defined rules.
Usage:
In your /App_Plugins/DotSee.AutoNode folder, you will find autoNode-sample.json with a commented example of a rule.
Copy this to a file named autoNode.json and edit it to your liking to load the actual configuration.
Here's an example configuration
"settings": {
"logLevel": "Verbose",
"republishExistingNodes": "false"
},
"rule": [
{
"createdDocTypeAlias": "sampleParentPage",
"docTypeAliasToCreate": "sampleChildPage",
"nodeName": "MyAutoGeneratedPage",
"bringNewNodeFirst": "true",
"onlyCreateIfNoChildren": "false",
"createIfExistsWithDifferentName": "false",
"dictionaryItemForName": "",
"blueprint": ""
}
]
Here's an explanation of global attributes:
Here's an explanation of rule-specific attributes:
Limitations / Warnings
You should not specify circular rules (i.e. one rule for creating doc B when A is published and one rule for creating doc A when B is published - this will cause an endless loop and leave you with a huge tree if you don't stop it on time! You can, however, create multiple rules for the same document type. That is, you may want docs B, C, and D to be automatically created when A is published, so you will have to create 3 rules.
The plugin creates the subnode only if there isn't any child node of the same doctype (by default it checks whether the existing node has the same name as defined in the rule, but you can override that and check only for doctype).
The plugin works for new nodes as well as existing nodes (if they are published and there is a rule in place and no subnode of the given doctype already exists).
This plugin works only with doctypes, so it's not possible at the moment to have any other criteria for automatic document creation. IF you need this, I'll be happy to add more logic.
This plugin was made to cover very specific, simple needs, like having a "Files" grouping node created automatically under each new "Article" node. It doesn't do miracles, so don't expect any 😃