Template Tags Reference¶
Load with:
{% reactive_signals form %}¶
Generates JSON for data-signals attribute:
Output:
{% render_reactive_form form %}¶
Renders a complete form with all fields, signals, and a submit button:
Uses the rg_forms/form.html template.
{% render_reactive_field bound_field %}¶
Renders a single field with its label, input, errors, and reactive attributes:
{% render_reactive_field form.order_type %}
{% render_reactive_field form.priority label="Custom Label" %}
Uses the rg_forms/field.html template. Generates:
- Wrapper
<div>withdata-showifvisible_whenis set <label>with required indicator- Input with
data-bind,data-computedas needed - Error messages
- Help text (static and dynamic
help_text_when)
{% render_field_group form group_name %}¶
Renders a field group with its header, description, and all fields:
Uses the rg_forms/field_group.html template. Generates:
- Group container with
data-showif the group hasvisible_when - Group label as heading
- Group description
- All fields in the group via
{% render_reactive_field %}
{% reactive_wrapper_attrs bound_field %}¶
Generates wrapper div attributes (for manual rendering):
Output:
{% reactive_input_attrs bound_field %}¶
Generates input element attributes (for manual rendering):
Output:
For computed fields:
{% required_indicator bound_field %}¶
Generates a required indicator (*) that respects required_when:
- Static required:
<span class="has-text-danger">*</span> - Dynamic required:
<span class="has-text-danger" data-show="$method == 'email'">*</span> - Not required: empty string
{{ field_name|signal_name }}¶
Filter that converts a field name to a Datastar signal reference:
Output: $my_field