jamienk Posted February 18, 2013 Share Posted February 18, 2013 Hi, From the PW admin, when I create a "new" child page, I'm first prompted to create a 'title' and 'name' before being sent to the fuller template. Can I by-pass this screen? Our "title" and "name" fields are auto-generated based on other field values, so it's a bit confusing to have to type something here... Thanks -Jamie Link to comment Share on other sites More sharing options...
JeffS Posted February 19, 2013 Share Posted February 19, 2013 Our "title" and "name" fields are auto-generated based on other field values, so it's a bit confusing to have to type something here... Hi jamienk, This thread might interest you.. http://processwire.com/talk/topic/2106-creating-a-page-without-a-title/ 1 Link to comment Share on other sites More sharing options...
ryan Posted February 20, 2013 Share Posted February 20, 2013 ProcessWire needs that screen, for the reasons mentioned in the thread JeffS linked. But automatically generated title and name fields in your case would mean your installation may not need it. So long as you understand that ProcessWire needs to have a page that exists in the DB before ProcessPageEdit operates on it, you can replace ProcessPageAdd with your own Process that does whatever you want. The way you go about it is to copy /wire/modules/Process/ProcessPageAdd/* to /site/modules/ProcessPageAddCustom/. Then rename the files in that new directory to reflect the directory name (i.e. ProcessPageAddCustom.module rather than ProcessPageAdd.module). Likewise, edit the module file and edit the class name to be the same. You now have a new module. In PW admin, go to Modules > Check for new modules. Click install for your new ProcessPageAddCustom module. Now edit the 'add' page in the admin by going to Pages > Admin > Pages > Add Page. Change the 'process' field from ProcessPageAdd to ProcessPageAddCustom. You are now in control of whatever happens on that 'add' screen. In your case, you may want to make your ProcessPageAddCustom.module auto-generate the page and then $session->redirect("../edit/?id=$page->id") to edit the page immediately. 1 Link to comment Share on other sites More sharing options...
Joss Posted February 20, 2013 Share Posted February 20, 2013 Ryan, for a completely different reason, that was a really useful little tutorial! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now