valan Posted December 17, 2013 Share Posted December 17, 2013 When PW admin user creates new page it gets "first screen" with title, name and template fields. For better usability, for specific templates I need to skip this "first screen" and let user directly enter page editing. As I see it: (1) template should be selected automatically based on parent page template "allowed children template(s)". Only if there could be several templates, then user should be advised with "first screen" and the only one "select template" field on it. (2) unique "name" field should be assigned automatically on page save. Page should not be saved before editing as it happens now after "first screen", only after editing/saving. "Title" field is not global in my setup. I guess the answer is to "use hooks", but I need some help to understand which functions to hook and how to check/supply template in (1) and manage saving-in-the-end in (2). Thanks! Link to comment Share on other sites More sharing options...
Soma Posted December 17, 2013 Share Posted December 17, 2013 To not write all over again: http://processwire.com/talk/topic/2696-check-the-template-of-the-page-which-will-be-added/ from two days ago, still fresh... Also it's not possible to edit page directly without saving it first, as some fields require a page ID to function, and that's why there's a page creation screen. 1 Link to comment Share on other sites More sharing options...
valan Posted December 17, 2013 Author Share Posted December 17, 2013 Soma, thanks! Looks informative enough to solve (1). As for (2) - I think that it is not good to compromise interface usability in favour of some fields requirements (even Page field ))). I'd rather suggest to handle such situations in these fields. But as far as I understand, solution may require some core modules re-thinking, so leaving it for Ryan consideration. Link to comment Share on other sites More sharing options...
Soma Posted December 17, 2013 Share Posted December 17, 2013 As far as I see it's only image/file and maybe page fields that need a page to be existent for custom php code in the settings. If you only use text fields it would be possible what you want. Otherwise you could still create a page with a unique name and redirect to the page edit screen for editing. Something like Pete was doing that was linked to in the thread I linked to. 1 Link to comment Share on other sites More sharing options...
valan Posted December 17, 2013 Author Share Posted December 17, 2013 Thanks Soma! Pete did exactly what I want. But I'd stay with the suggestion that "generate children page unique name and jump directly to edit with template X" should be embedded into admin interface for any template. As I see it - it is too common task to be left for developers only. )) Thanks! 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