Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kfir 6 posts 74 karma points
    Feb 29, 2016 @ 10:13
    kfir
    0

    Create default childs to node in umbraco

    I'm trying to find out how to force node to create only one node child of other type ?

    I have 'hotel' node and i want to add one 'rooms' node and one 'facilities' node ('rooms' create 'room' and 'facilities' create 'facility')

    I prefer to do it with the management system (if possible) but code behind be good also !

    Thanks in advance for all helpers!

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Feb 29, 2016 @ 16:51
    Alex Skrypnyk
    0

    Hi kfir,

    You can't create rule that only one child node of some document type can be under the current node, but you can subscribe on create node event, check what type is it, and decide can you create one more or no.

    Read about Umbraco content service events:

    https://our.umbraco.org/documentation/reference/events/ContentService-Events

    Saving event looks like what you need.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft