[support] CCK title field set width?
Broyhill, Gary
Gary.Broyhill at lr.edu
Thu Nov 18 15:26:56 UTC 2010
Thanks for the info Neil. This is the first time I've run into this issue so, I apparently have some fun ahead of me :)
Gary
------------------------------
Message: 4
Date: Wed, 17 Nov 2010 18:30:05 -0300
From: Neil Coghlan <neil at esl-lounge.com>
Subject: Re: [support] CCK title field set width?
To: support at drupal.org
you want to look into making your own mini-module and use form_alter to
adjust the width of the text field
once you've got the correct form, you need something like this:
$form['title']['#size'] = 55;
or whatever size you want.
here is what you'd need for the blog create form - changes title field
size and alters its label too.
function mymodule_form_alter(&$form, $form_state, $form_id) {
if($form_id == blog_node_form) {
# alters blog node create form. Changes 'Title' to 'Title of blog post'
and alters size of title text box.
$form['title']['#title'] = t('Title of blog post');
$form['title']['#size'] = 55;
}
}
Remember to change "mymodule" to your actual module title and make .info
file too.
On 17/11/2010 18:20, Broyhill, Gary wrote:
> Good day Drupalers:
>
> When creating a new content type, it seems that I cannot change the
> width of the TITLE field. For all other fields that I create, I can
> set the width.
>
> Anyone know how to make this change? I found something on drupal.org
> saying you can do it with CSS but I wonder if that's the best or only
> way?
> http://drupal.org/node/113399#comment-193937
>
> Thanks,
>
>
> --
> Gary Broyhill
> Webmaster
> Lenoir-Rhyne University
> www.lr.edu
> gary.broyhill at lr.edu
> (828)328-7379
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20101118/b86308b3/attachment-0001.html
More information about the support
mailing list