Autonode

Intro

This functionality creates new nodes upon publishing a node, following user-defined rules. With configurations to control node creation conditions, automatic node creation simplifies your workflow.

Configuration

                    
                        
"DotSee.Discipline": {
  "AutoNode": {
    "Settings": {
      "LogLevel": "Verbose",
      "RepublishExistingNodes": "false"
    },
    "Rules": [
      {
        "CreatedDocTypeAlias": "pageHome",
        "DocTypeAliasToCreate": "folderConfiguration",
        "NodeName": "Settings",
        "BringNewNodeFirst": "false",
        "OnlyCreateIfNoChildren": "false",
        "CreateIfExistsWithDifferentName": "false",
        "DictionaryItemForName": "",
        "Blueprint": ""
      },
      {
        "CreatedDocTypeAlias": "folderConfiguration",
        "DocTypeAliasToCreate": "configGlobalSettings",
        "NodeName": "Global",
        "BringNewNodeFirst": "false",
        "OnlyCreateIfNoChildren": "false",
        "CreateIfExistsWithDifferentName": "false",
        "DictionaryItemForName": "",
        "Blueprint": ""
      },
      {
        "CreatedDocTypeAlias": "folderConfiguration",
        "DocTypeAliasToCreate": "configBackOfficeSettings",
        "NodeName": "Back Office",
        "BringNewNodeFirst": "false",
        "OnlyCreateIfNoChildren": "false",
        "CreateIfExistsWithDifferentName": "false",
        "DictionaryItemForName": "",
        "Blueprint": ""
      },
      {
        "CreatedDocTypeAlias": "folderConfiguration",
        "DocTypeAliasToCreate": "configSeoSettings",
        "NodeName": "SEO",
        "BringNewNodeFirst": "false",
        "OnlyCreateIfNoChildren": "false",
        "CreateIfExistsWithDifferentName": "false",
        "DictionaryItemForName": "",
        "Blueprint": ""
      }
    ]
  },
  "NodeRestrict": {
    "Settings": {
      "PropertyAlias": null,
      "ShowWarnings": true
    },
    "Rules": [
      {
        "ParentDocType": "pageHome",
        "ChildDocType": "folderConfiguration",
        "MaxNodes": 1,
        "ShowWarnings": true,
        "CustomMessage": "Only one Settings Node is allowed.",
        "CustomMessageCategory": "Limit Reached",
        "CustomWarningMessage": "Only one Settings one can be created under Home.",
        "CustomWarningMessageCategory": "Limit warning"
      }
    ]
  }
}
                    
                

Configuration

                    
                        
.code-dark code[class*="language-"],
pre[class*="language-"].code-dark {
    color: #ccc;
    text-shadow: none !important;
    border-left: 0;
}
                    
                

Explanation of attributes

  • createdDocTypeAlias: The document type alias of the document being published. IF the document being published has the specified doctype alias, then the rule will execute.
  • docTypeAliasToCreate: The document type alias of the document that will be automatically created as a child document.
  • nodeName: The name of the newly created node.
  • bringNodeFirst: If set to true, will bring the newly created node first in the Umbraco back-end.
  • onlyCreateIfNoChildren (optional): This, naturally, regards republishing. If set to true, then republishing a node that already has child nodes (including any already automatically created nodes) will NOT run the rule. If set to false, the rule will run even if the node being published already has children. Note: If this setting is set to false and there are already automatically created nodes under the node being published, then they won't be created again. (The check is performed on both doctype and node name as defined in rules - if such a node is found, it will not be created again)
  • createIfExistsWithDifferentName (optional): This is true by default - it means that if you rename the automatically created node and republish its parent, a new node will be created. If you need to restrict node creation even more, then you can set this to False and it will not create a new node when a node of the same doctype is found.
  • dictionaryItemForName (optional): The key for a dictionary item which will specify what the name of the new node will be in a multilingual Umbraco installation. This means that new nodes will take their names according to the value of this dictionary entry and names will be different for each language. (The createIfExistsWithDifferentName setting also takes multilingual names under consideration).If the dictionary key is not found or the corresponding dictionary entry contains no value, then it falls back to the default new node name as defined in the rule.
  • blueprint (optional): The name of a blueprint (aka "content template") that will be used to populate the newly created node with content.

Example

You can define rules that determine the document types to be included, node names to be added (either statically or from dictionary entries), and even control the placement of the new node within the Umbraco back-end. 

autonode
you can choose to republish a node if it already exists and to create nodes automatically only if no other child nodes exist.

Demo video

Download sample file (2.8 kb, json)

Example

You can define rules that determine the document types to be included, node names to be added (either statically or from dictionary entries), and even control the placement of the new node within the Umbraco back-end. 

autonode
you can choose to republish a node if it already exists and to create nodes automatically only if no other child nodes exist.