Opened 17 years ago
Closed 16 years ago
#6270 closed (wontfix)
There should be a way to easy edit a form's label_tag output!
Reported by: | italomaia | Owned by: | David Tulig |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | label, edit | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Well, for what i noticed, label_tag output is plain text, so, using a filter for the change would be difficult.
Something like: if you would like your filed help_text to become you label's title, so that a javascript framework
could get all your labels titles and make good looking "tip boxes" for them, how could one acomplish that?
It would be necessary to subclass ModelForm or Form, or even create some bad looking filters...bad solution.
A suggestion for the work would be that the label_tag output was not plain text, but an object, widget-like.
So that a object.widget.attrs.update({'title':value}) could be used through filters, or even a option for
the described behavior ( help_text as the label's title ).
I believe that would make the web-designers lifes easier.
Attachments (1)
Change History (3)
by , 17 years ago
Attachment: | label_attrs.diff added |
---|
comment:1 by , 17 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
If you need custom label attributes you ought to simply do that at the template level. Something like <label class="woo">{{ field.label }}</label>{{ field
}}.
Adds "label_attrs" to the Field constructor to define attributes for the label tag