Jon Posted February 3, 2016 Posted February 3, 2016 Hello all, Just wonder if it's to add a new button on custom admin page that adds a new page with a specific template. I have got the parentid within the button link that works but would really like to set the template aswell. Cheers Jon
mr-fan Posted February 4, 2016 Posted February 4, 2016 https://processwire.com/talk/topic/11141-dashboard-redux/#entry104459 best regards mr-fan
Jon Posted February 4, 2016 Author Posted February 4, 2016 Hello Mr Fan, That is similar to the code I've used, But doesn't set the template. Basically what I have is a parent "Reviews" which can have 3 different Child templates. When dashboard button is press I would like to set a specific template or even if I could set a default template but still have the option of selecting the 2 other templates. What happens at the minute is the last template used if remembered. Cheers Jon
Jan Romero Posted February 4, 2016 Posted February 4, 2016 You can set a default template by supplying the GET parameter “template_id”, or the POST parameter “template”: http://example.com/processwire/page/add/?parent_id=1024&template_id=46 I’m not sure about forcing the template. You could probably specify a default name format in order to bypass the page-add screen directly, or hook into ProcessPageAdd to manipulate the form. 4
Jon Posted February 4, 2016 Author Posted February 4, 2016 That's prefect Jan exactly what I was trying to achieve! Many thanks Jon
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