Rendering zope.schema.Bool as checkbox

We have a zope.schema.Bool in a supermodel XML with title and description field.

Using <form:widget type="z3c.form.browser.checkbox.CheckBoxFieldWidget"> renders the two checkboxes yes and no.

Using <form:widget type="z3c.form.browser.checkbox.SingleCheckBoxFieldWidget"> renders a single checkbox (OK!) but the description is completely omitted :face_with_thermometer:

Anything missing here?

No, i think thats the default behavior. register your own subclassed widget, shoot with cannons on sparrows.

:disappointed:

Isn't it the label which is set to empty in the code of the SingleCheckBoxFieldWidget?

Reading the comment the assumption is that the label is already displayed by another part of the template.

I also once crossed that bridge:

    <field name="farbtone_series" type="zope.schema.Bool" lingua:independent="true">
      <title>Farbtöne Serien</title>
      <description>Farbtöne in Serien anzeigen</description>
      <default>False</default>
      <required>False</required>
      <!-- render as plain checkbox
        <form:widget type="z3c.form.browser.radio.RadioFieldWidget" />
      -->
    </field>

You can leave out form widget to render:

checkbox-widget
checkbox-view

The mangled list is apparently an artifact of @@ploneform-render-widget

Plone Foundation Code of Conduct