-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e2be20
commit 2516cb4
Showing
4 changed files
with
55 additions
and
13 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ Topics | |
|
||
install.md | ||
get_started.md | ||
tags.md | ||
formify_helper.md | ||
layout.md | ||
component_design.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Template Tags | ||
|
||
## render_form | ||
|
||
This tag can render form or formset. | ||
|
||
It will iterate and render all form fields automatically. | ||
|
||
## render_submit | ||
|
||
This tag is to render the submit button. | ||
|
||
You can also add extra variables | ||
|
||
```html | ||
{% render_submit text='Sign In' css_class="custom-css" name='action_primary' value='action_primary' %} | ||
``` | ||
|
||
`render_submit` behavior can be customized by overriding `formify_helper.render_submit` method | ||
|
||
Please check [Formify Helper](./formify_helper.md) to learn more. | ||
|
||
To use formify_helper attached to the `form` instance, you can pass `form` to the `render_submit` like this: | ||
|
||
```html | ||
{% render_submit form text='Hello' css_class="btn btn-primary" %} | ||
``` | ||
|
||
If you have svg in submit button as indicator, you can use this approach to make your code DRY. | ||
|
||
## render_field | ||
|
||
In some cases, if you want to render a specific field, you can use this tag. | ||
|
||
```html | ||
{% render_field form.email %} | ||
``` | ||
|
||
You can also override formify_helper variable like this: | ||
|
||
```html | ||
{% render_field form.email form_show_labels=False %} | ||
``` | ||
|
||
## render_form_errors | ||
|
||
This tag can render form non-field errors. |