[drupal-devel] [feature] Patch to add 'wide' to class of wide form items. (Solves theme problems with wide fields.)

drumm drupal-devel at drupal.org
Tue Aug 2 18:12:31 UTC 2005


Issue status update for 
http://drupal.org/node/28044
Post a follow up: 
http://drupal.org/project/comments/add/28044

 Project:      Drupal
 Version:      cvs
 Component:    base system
 Category:     feature requests
 Priority:     normal
 Assigned to:  jjeff
 Reported by:  jjeff
 Updated by:   drumm
 Status:       patch (code needs review)

I think this is greatly needed.


I do not think making any form element with a size greater than 40 into
a wide field is a good idea. For forms in blocks a wide field might have
a smaller size.


A better way to implement this would be using a special value of the
$size argument to mean 'wide'. This could be 0 and may have an
associated constant such as FORM_WIDE. When the size is 0 then that
attribute may be omitted and the class added. This is a lot more to
patch since that requires finding every call to form_* which has a
large width, but I think the result will be worth it.




drumm



Previous comments:
------------------------------------------------------------------------

Tue, 02 Aug 2005 15:13:29 +0000 : jjeff

Attachment: http://drupal.org/files/issues/common.wide.patch (5.33 KB)

We've all seen wide Drupal forms break a fixed width theme by "blowing
out" the right side of the theme. Here's a solution to the problem.


This patch adds a "wide" class tag to any textfield, password,
textarea, or autocomplete form item with a width (size) of more than 40
characters. By also adding a css rule in drupal.css that sets any "wide"
form-items to width:100%, we keep these form items under control. Of
course the assumption is that any form items with a width greater than
40 are intended to be full width. Opposing viewpoints are welcome.


Here's the css rule:


.form-item .wide {
  width: 100%;
}


patch for common.inc is attached.




------------------------------------------------------------------------

Tue, 02 Aug 2005 15:45:46 +0000 : Prometheus6

Actually, I use this rule in my style.css:


form {
  width: 95%
}







More information about the drupal-devel mailing list