I've created some text fields using CCK, but the text fields display much wider than they need to be. I was wondering if anyone knows how I can change the #size parameter (see http://api.drupal.org/api/5/file/developer/topics/forms_api_reference.ht... ) to modify the way that a text box appears? I tried modifying the node_field table to add size s:4:"size";s2:"16"; with the following command
update node_field set global_settings = 'a:5:{s:4:"size";s2:"16";s:15:"text_processing";s:1:"0";s:10:"max_length";s:2:"16";
s:14:"allowed_values";s:0:"";s:18:"allowed_values_php";s:0:"";}' where field_name='field_first_name';
(line broken for readability)
But it didn't seem to do anything. Can someone suggest a good way to change how to modify the displayed size of a text box using CCK?
On a related note - I saw "content templates" http://drupal.org/project/contemplate but wasn't sure if that (a) was designed to solve this problem, (b) was still maintained (c) was obsoleted by this http://drupal.org/node/17565 (custom themes per page)
Help?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | cck_text.module_size.patch | 1.46 KB | rar |
Comments
Comment #1
rar commentedPlease make the following changes to CCK text.module to specify the size of a text box.
Line 32: add the following
Lines 69:70 (only the second line is modified)
Lines 306:317, (add the line starting with 'size' ...)
The changes are small so I wrote them up manually - let me know if you want an actual patch
Comment #2
rar commentedupdated to show just the text.module and changing to "Bug"
Comment #3
rar commentedPatch attached
Comment #4
rar commentedNote: the css file /modules/node/node.css will override your "size" field because of the following
To get the text boxes to show up with the sizes you specify you will have to deal with that.
Comment #5
wisdom commentedThe patch seems does not help to control the size of text box field with multiple rows. For single row text field adding the following in the style.css file controls the size.
div.node-form input.form-text {
width: 25%;
}
But how to resize multiple rows cck text fields still remains.
Comment #6
karens commentedSee http://drupal.org/node/181246.