I've created a nice submission form for our would-be subscribers:

http://test.epbj.com/?q=node/add/subscription-contact

But hopefully you can see what my obvious problem is. I have no need for the Body (in this example, named Comments) section. Is there a way to remove it? To my understanding Title and Body are basic Drupal fields and have to exist... so my next question, is it just possible to hide it? It can say as an element, but I just don't want it to be seen.

Alternatively, can I change the default size of the box? It starts as huge. Maybe if it were condensed to it's smallest displayable size I could work around it.

Also, the forced weights for Title and Body are -5 and 0, respectively... I can't possibly think of a reason for that. I've tried to make that form in that order, while working around the Title and Body static weights, but with only 4 numbers in the middle to work with, it's made it impossible.

Any help is appreciated!

Comments

keylope’s picture

If you don't want a body field, the only way to create a form is through the Form API, but if you want to create a node out as a result, I don't think that you'll be able to do that. I know the body field as an id of edit-body, but if you use CSS to hide the textfield, you will be hiding it for all content types unless if you can find a unique class or id to limit how it targets the body input field.

You might see if the body field can be contained in a fieldgroup and then you could default that fieldgroup to be collapsed? I don't know if that will work, but it would be worth looking into.

cmarcera’s picture

Both Title and Body unfortunately have no group options that can be applied to it :(

I will poke around with the Form API. Thanks for the idea.

amariotti’s picture

Another option might be to implement the formfilter module that will allow you to hide certain form fields from users other than the administrator. Might be a workaround.... good luck

cmarcera’s picture

Tried Form Filter. It had a nice checkbox saying "Hide body_text" in the body row... however checking it and then loading the form up did nothing :(

I've managed to add some CCK fields that have made the arrangement a bit better. I'd still like to either shrink the Body textarea or hide it altogether, but some progress is being made!

brenda003’s picture

Edit the content type and remove the text for the body field... That should remove it for you.

cmarcera’s picture

lol - THANK YOU :) The simplest answer was the correct one. Had I read closer...

To omit the body field for this content type, remove any text and leave this field blank.

Duh *sigh*

Thanks again.

brenda003’s picture

It's often easiest to overlook the simplest solution. :)

zilla’s picture

wow, i was just going through this same exercise, searching the forums, found this and wiped the sweat from my brow...duh. it says it right there in the admin interface ;)

smscotten’s picture

I edited the content type and removed the text for the body field in the bookreview type (created by the bookreview module) as I've been trying to get to the bottom of #241233: Just lost "read more". All this seems to do is remove the title from the Body field in the form. Does this behave differently because bookreview is not a CCK type?

motto’s picture

Thanks for asking that really basic question. That helped me a lot. I wonder why there isn't just a 'hide' checkbox for all people - like me - who are to quick to read all descriptions properly :-)

zaglick’s picture

Reading is kind of a critical skill I guess. Thank You

cientista’s picture

I was having the same problem too. the first reply is wrong therefore, and should be removed from the top of the list. Drupal is great isn't it!

Garry Egan’s picture

I missed that for 5 years! Never saw that once. THANKS, MAN. My admin pages look SOOOO much better now.