Opened 8 years ago

Closed 8 years ago

#6444 closed (duplicate)

Filter for adding css classes to an widget

Reported by: italomaia Owned by: nobody
Component: Template system Version: master
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: UI/UX:

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 Changed 8 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design 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 Changed 8 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

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