SwimToWin Posted March 23, 2019 Share Posted March 23, 2019 The basic Processwire workflow assumes that I (as an Editor) want to save new Pages in draft mode - and therefore new pages are always set to unpublished by default. To publish the page, it is necessary to actively press "Publish", otherwise the Page will not be visible. The workflow is: Add new Page Status is now "Unpublished: Not visible on site." Press Publish - the page is now visible on site I want to publish pages right away (without having to press Publish). Where is that configured? ProcessWire 3.0.123 Uikit v3 admin theme (0.3.0) Link to comment Share on other sites More sharing options...
Autofahrn Posted March 23, 2019 Share Posted March 23, 2019 You may rename the Save and Publish buttons... ? The first "save" only creates the page in page tree and assigns the template to it. You can not actually enter any content upon page creation, so keeping the page unpublished seems very reasonable to me. Maybe the Save button could be named "Create" to better reflect what happens. At this moment the page really should not be published automatically, since it may contain required fields, where your template code rely on. With the template assigned, you'll have fields to enter content and see the Publish button. After entering the data you press "Publish", which effectively is "Save+Publish" in this case. I don't see an extra step to publish a page after entering its content, since this already is the default. Only in case the selected template does not have additional fields you'll see additional Save+Publish buttons. Are we talking about this situation? 2 1 Link to comment Share on other sites More sharing options...
dragan Posted March 23, 2019 Share Posted March 23, 2019 if you have $config->advanced = true in your site/config.php file, then you'll see some addtl. fields in template > advanced: Although I would also be careful with that. 2 1 Link to comment Share on other sites More sharing options...
adrian Posted March 23, 2019 Share Posted March 23, 2019 Putting this in your ready.php or admin.php should do it. You may want to add additional checks for admin only (not via API). $this->addHookAfter('Pages::added', function($event) { $p = $event->arguments[0]; $p->removeStatus('unpublished'); $p->save(); }); But, @Autofahrn has some excellent points about publishing a page which doesn't have any content other than the title, so use this with caution! 1 1 Link to comment Share on other sites More sharing options...
SwimToWin Posted March 24, 2019 Author Share Posted March 24, 2019 Excellent suggestions. Thanks to all.@adrian, your solution works like a charm: Press New Set Title and Name (Template is currently unassigned) Press "Save" - Page now gets published with the chosen template, all template fields are blank. Setting pages to unpublished is still possible. This is how I want the flow. 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