Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you remove the default title and body fields in a CCK generated Drupal content-type?

Tags:

drupal

cck

When you create a new content type in Drupal using the Content Creation Kit, you automatically get Title and Body fields in the generated form. Is there a way to remove them?

like image 661
Craig Hyatt Avatar asked Sep 18 '08 03:09

Craig Hyatt


People also ask

What is a content type in Drupal?

In Drupal, a Content Type is a pre-defined collection of data types (Fields) which relate to each other by an informational context.

What are fields in Drupal?

Fields are the building blocks of Drupal's powerful content modeling system. The Field API allows for the development of custom field types, field widgets, and field formatters to suit almost any data display and collection needs.

What is used to link two nodes of two different content types Drupal?

After installing References, add a node reference to one of the content types that you can use to point to the other one. When creating the View, add a Relationship to the Referenced node. You will then be able to see fields from the Referenced nodes when you go to add a Field to the View.

How is Drupal content presented?

Content items managed by the Node module are typically displayed as pages on your site, and include a title, some meta-data (author, creation time, content type, etc.), and optional fields containing text or other data. (Fields are managed by the Field module in Drupal 7.) Each node has an unique ID.


3 Answers

If you're not a developer (or you want to shortcut the development process), another possible solution is to utilize the auto_nodetitle module. Auto nodetitle will let you create rules for generating the title of the node. These can be programmatic rules, tokens that are replaced, or simply static text. Worth a look if nothing else.

like image 94
William OConnor - csevb10 Avatar answered Nov 08 '22 10:11

William OConnor - csevb10


To remove the body edit the type, expand "Submission form settings" and put in blank for body field label. For title you can rename it to another text field. If you really have no need for any text fields you can create a custom module, say called foo, and create function foo_form_alter() which replaces $form['title'] with a #value when $form['type']['#value'] is your node type.

like image 44
Steven Noble Avatar answered Nov 08 '22 11:11

Steven Noble


No need to install anything:
when editing the content type, press "Edit"
(on the menu of Edit | Manage fields | Display fields )
click on the Submission form settings

on the Body field label:
Leave it blank, it would remove the Body field.

like image 27
Asaf Avatar answered Nov 08 '22 10:11

Asaf