Copied to clipboard

Flag this post as spam?

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


  • Paul de Quant 403 posts 1520 karma points
    Nov 24, 2014 @ 09:27
    Paul de Quant
    0

    Create a collection of pages programatically

    Hello,

    We have a lot of templated sections in our CMS and I would like to know if it's possible, so that when a user creates a child page in a specified section that a collection of templated sub pages are created at the same time to save the user time from creating the same 5 sub pages every time.

    > Home

    > > Profiles (so this is my specified section)

    > > > Bob Jones (everytime I create a page at this level I want it to create the following subpages)

    > > > > About (this page will be automatically created)

    > > > > Interests (this page will be automatically created)

    > > > > Work (this page will be automatically created)

    I hope this make sense.

    Thanks

    Paul

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 24, 2014 @ 09:50
    Jan Skovgaard
    100

    Hi Paul

    I believe it should be possible. You need to hook into the events API and then check that when a page of a certain type is created then X child pages should be created.

    I've been looking for the "Create" event in the documentation http://our.umbraco.org/documentation/reference/events-v6/ContentService-Events but it does not seem like it exists but I think you should be able to achieve the same thing by listening to the "Saved" event.

    I hope this makes sense.

    And don't get fooled by the "events v6" naming btw - The underlying API is the same in v6 and 7.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft