In handlebars, the required helper takes an id of a form field. Where is this configured? On my new_community_post_page.hbs, I have
<div class="form-field {{#required 'details'}} required {{/required}}">and the helper evaluates to false. I would like it to be true. How do I tell Zendesk that the ‘details’ field is required?
The required helper in Zendesk Guide's Handlebars templates checks whether a given form field ID is marked as required in the Form Setup configuration in Zendesk Support.
To have the required helper evaluate to true for the 'details' field, you need to make sure that the corresponding field (with the field ID or key 'details') is set as required in your form configuration.
Here’s how to configure this:
-
Identify the field: Confirm that the 'details' field corresponds exactly to the field's key or ID in your form. If you’re unsure, check the form’s fields in Zendesk Support under Admin Center > Objects and rules > Forms.
-
Mark the field as required: Edit the form that’s used on the community post page and set the 'details' field as required.
-
If the field 'details' is a custom field or part of the community post form, ensure that it is enabled and required there as well.Save the form: Once the field is marked required in the form settings, the required helper in your Handlebars template will evaluate to true when you reference that field by its ID.
If you continue to see the helper evaluate to false, double-check that:
- The field ID/key matches exactly.
- You’re editing the correct form used by the community post page.
-
Let me know if you need help locating the form or adjusting the field settings!There are no caching issues—try clearing your browser cache or previewing in an incognito window.