diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt index cf6b933ee4..8ac950e589 100644 --- a/docs/topics/forms/index.txt +++ b/docs/topics/forms/index.txt @@ -290,6 +290,37 @@ templates: corresponding to this field. You can customize the presentation of the errors with a ``{% for error in field.errors %}`` loop. +Reusable form templates +----------------------- + +If your site uses the same rendering logic for forms in multiple places you +can create a template that contains just the form loop and use the +:ttag:`include` tag to reuse it in your other templates:: + +
+ + # In form_snippet.html: + + {% for field in form %} +