Adding a repetitive page structure

Juan Alchourron asked on August 6, 2017 21:33

Hello !

Need to create the following tree structure (Kentico pages), having 'Node' as a doc_type, and 'Sub-Node' as different doc_type, child of 'Node'. I have 500+ Nodes, and 3+ Sub-Nodes (always the same sub-nodes)

  • Node A
  • - Sub-Node A-X
  • - Sub-Node A-Y
  • - Sub-Node A-Z
  • Node B
  • - Sub-Node B-X
  • - Sub-Node B-Y
  • - Sub-Node B-Z

...

...

My question is: other than copy-pasting my structure 500 times, and modifying some data on each page, is there any other way to add a new 'node' document, already having the 3 'sub-node' children attached to ? In other terms, is is possible to have the action of : Add-> new document

adding all this 4 documents at once ?

  • Node
    • Sub-Node X
    • Sub-Node Y
    • Sub-Node Z

Recent Answers


Roman Hutnyk answered on August 7, 2017 09:32

I can remember working with department sites (that was Kentico v. 6 or 7, so this could change) and there was a possibility to create Department template and that was very similar to what you're looking for: a subtree, where you could add department landing page, news listing, news detail, etc. So once you configure your department template (subtree) editor could go into content tree and create a new department, which would create all those pages at once.

However, not sure if it is available in latest versions of Kentico. You could try to install intranet portal site and check for departments there.

1 votesVote for this answer Mark as a Correct answer

Matt Nield answered on August 7, 2017 11:56

Assuming the sub-nodes are always basically the same, you could create a global event handle after creation of Node document that would create the three child Sub-node documents. It's custom code, but it'll do what you need. Checkout out the documenation on handling global events.

1 votesVote for this answer Mark as a Correct answer

Zach Perry answered on August 7, 2017 16:10

I would do a combination of what Matt and Roman said. The department options like Roman mentioned are in Kentico still, but it creates community groups and media libraries when it creates a new department I believe. I would create a template structure in the Tree, create a event handler so when a certain document type is inserted, it copies the structure from the template. If the sub items need to have custom fields, you could have those be set originally by the first node that was inserted and just update the fields in the event handler.

1 votesVote for this answer Mark as a Correct answer

Juan Alchourron answered on August 7, 2017 17:17

Thank you!

I'll try, and post the solution.

Juan

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.