Opened 16 years ago

Closed 16 years ago

#6444 closed (duplicate)

Filter for adding css classes to an widget

Reported by: italomaia Owned by: nobody
Component: Template system Version: dev
Severity: Keywords: filter, mtv, designer, css
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As a widget class is something related to the T in the MTV django design, it should be possible to change a widget's class through
a template. So, who's the fellow that deals with the T? The designer! Not necessarily the programmer. And that someone should not need to know
python programming. The designer should be capable of adding a class to a widget in a straight forward way. A filter seems like the reasenable
solution.

Something like this should work:

<div>
form.field|filter:"class1 class2 class3"
</div>

and give the proper output. I suggest a simple name for the filter, something like mclass ou css.

Change History (2)

comment:1 by Chris Beaven, 16 years ago

Triage Stage: UnreviewedDesign decision needed

Hrm... I get the argument but I'm not sure I quite see the necessity.

Pushing to design decision, perhaps you can bring this up on django-dev?

comment:2 by James Bennett, 16 years ago

Resolution: duplicate
Status: newclosed

Aren't there already multiple tickets open with variations on easy ways to add CSS classes to parts of a form?

Note: See TracTickets for help on using tickets.
Back to Top