Page MenuHomePhabricator

Always show the checkbox when the boolean type is added in the template insert dialog
Open, MediumPublic


From the ever-helpful 197.218 at

The checkbox only appears if the template exists on a page with either value of 0 or 1.

Steps to reproduce:

  1. Create a template "testbool"
  2. Add the following to the template:
	"params": {
		"p1": {
			"type": "boolean"
test {{{p1}}}
  1. Go to test page
  2. Click insert template
  3. Insert "testbool"
  4. Add p1


A checkbox to select or deselect (or unset) a true / false parameter.


The interface presents a blank text box.

Proposed solution

Always show the checkbox with false as the default, and unset it (e.g.{{testbool}}) when the user
removes the parameter from the insert dialog

Alternate solutions

Add a new toggleswitch with the three states (on, off, unset (e.g. {{testbool|p1=}} or {{testbool}}) , e.g.


It was initially quite confusing that the value 1 or 0 must be set to see the checkbox. It took me quite a while to figure that out. Even setting the parameter default as 1 doesn't make the checkbox initially appear.

One benefit of the alternative solution is that this would also resolve the problem discussed in

Having a tri-state toggleswitch would allow users to remove the template parameter by setting it to the third state (undefined). This in turn could be interpreted as either :



The first is probably best for the visual editor because it would differentiate between someone adding a parameter and leaving it undefined, and someone never adding that parameter. Although the second example would probably be preferred by editors.