Automatically creating pages

I am trying to figure out a way to automatically create pages when certain tasks on the site are completed. Here is an example:

My site has a visitor's section, on which the main page is very blog-esque with a short description of each item on the main page. There is a link to "Read More...", leading the user to an individual page for the item selected. I have created a custom block for entries on the main page and the site mod to enter the short descriptions but each time that is done, I would really like a template page with certain information to be automatically created with the basic information entered into the block, all ready for the mod to edit the new page, rather than forcing them to create a new page manually and start basically from scratch.

That might be a little hard to understand so please ask questions if it's not clear.

View Replies: View Best Answer
MysteriousCleon replied on at Permalink Reply
So like what you want to have on that freshly created page?

This is what I understood: you write blog post teaser on main page, and then create new page, which you want to have some data in?

Normally this is taken from another end - you create blog post on new page, and then automatically create teasers in main page - is it something what you mean?
rhuffman8 replied on at Permalink Reply
That would probably be a good idea for that particular situation and would probably be easier to implement but there was another situation where I wanted to be able to do this.

At completion, the site members will have to be approved by an admin before their accounts are created. Once a user has been approved, I need a "project page" to be created which allows access to the users working on that particular project and admins only.
Perhaps there is an easier way to accomplish this too but I have not been able to think of one thus far.
formigo replied on at Permalink Best Answer Reply
Without getting into the specifics of what you are trying to achieve you can create pages programatically and you may find events useful if the tasks are core concrete5 routines.

If the tasks are within your block your save method might be the place to trigger your page creation routines.

Two links that might assist:-

Hope that helps.
xaritas replied on at Permalink Reply
It sounds like what you want is basically a Prototype for any given page type, such that when you added a page, it's automatically filled in with a copy of all the content on its prototype, which has your placeholder data.

The good news is, the behavior to support copying pages is built into the system. You can see it when you move pages around in the Sitemap. If you drag a page onto another page, you get the option of creating a copy. Bad news, you're going to have to look at the code yourself to extract the behavior you want. I have not messed around with how this works, so it could be a one-liner or a huge mess. But I happen to have the same thing on my to do list. If I get to it I'll update here.
thebogdan replied on at Permalink Reply
I'm looking for a way to create a page (hopefully with subpages) by filling out a form on the site. Example: a user wants to submit a new restaurant to the site. On the Restaurants page the user fills out a form with restaurants name, address, etc and submits the form. Under Restaurants page a new page is created with rating/comments block, Google map, etc.

Any specific suggestions? Thanks!