ryancramerdesign / ProcessWire

Our repository has moved to https://github.com/processwire – please head there for the latest version.
https://processwire.com
Other
727 stars 201 forks source link

Add empty option on template select at the top #2065

Closed juergenweb closed 6 years ago

juergenweb commented 6 years ago

According to this discussion in the forum it would be great if you could implement this into the core.

The situation: The template select field offers editors to choose between various templates. At the moment always one template is pre-selected. This leads to that editors often ignore (or dont take care) of this field and press the save button. After that they notice that they have choosen the wrong template. It would be better that no template is pre-selected so that editors will get an error message if they do not choose on of them. So editors will be forced to select one. In other words they need to think over which kind of template to choose.

At the moment we have solved this issue via a Hook, but I think it would be better to add this directly into the core.

screenshot-www juergen-kern at-2017-11-05-19-24-27

Best regards.

teppokoivula commented 6 years ago

If this is added to the core, perhaps it should depend on a ProcessPageAdd module setting?

Obviously depends on the use case, but in our case more than one template may be allowed, but almost always "default" is the one that should be used. An empty option would mean that almost every time users add a new page they need extra clicks to choose a specific template.

Although I appreciate your point of forcing the user to think about their choice, and I have heard a couple of reports about this same problem from our users, in my opinion this would also make the workflow less intuitive.

juergenweb commented 6 years ago

Hello Teppo, Thanks for your contribution and I agree totally with you.

Maybe it will be an option to add an additional settings field to the template settings where the allowed children templates are selected to mark the pre-selected template.

screenshot-www juergen-kern at-2017-11-06-09-35-42

This could even be a default text field where you have to write the name of the default template or it could be a JS-rendered select field where you can choose the prefered default template. If nothing is entered (selected) than the empty option (or maybe an option with a text like "Please select") will be the default option. Otherwise the choosen template will be the default option after rendering the form.

juergenweb commented 6 years ago

This issue was posted in the new repository (https://github.com/processwire/processwire-issues/issues/424)