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 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.
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
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
is working on a reply...