How to Add New Content Type to Drupal-Based Site
As you develop your Drupal website, you may occasionally find yourself needing to create custom content types other than the ones that come with a basic Drupal installation (Page and Story).
Here’s how to create that new content type:
- Login to your Drupal site;
- I recommend you to install some additional modules to create more functional content types:
· File Field
· Image
· Image Cache
· CCK (enable Content, File Fields, Image Field, Number and Text)
You can find the detailed instructions to do this in the previous article: http://phpmysql.guru/2010/01/how-to-install-a-new-module-to-drupal-based-site/#more-677).
- Select Administer > Content Management > Content types item from the admin left navigation menu:
- You will see the list of all the content types on your site. The default ones are Page and Story:
- Click Add content type tab at the top of the page;
- Fill in the content type parameters:
· For Name, enter the name of your content type as your users will see it.
· For Type, enter the name Drupal will use internally to refer to this content type.
· View through Workflow settings section. You can specify a number of useful options that will apply by default to all items of this type here.
· Decide whether or not you’d like to allow comments by default for items of this new type under Comment settings.
7. Scroll to the bottom of the page and click Save content type button:
From now, whenever you wish to create content for your site, you will see a new entry.
When new content is added to your site, you can view it through admin > Administer > Content Management > Content.
There are a few more complex things you can do with custom content types; for instance, your custom content type can collect and display more than just the standard fields. This is very easy to do:
- In the left navigation menu, choose admin > Administer > Content management > Content types.
- You will see a list of all the content types currently available. Choose the manage fields link next to the content type to which you’d like to add a field.
- In one of the blank New field rows at the bottom of the list of fields, enter your new field’s Label and Field name.
- Choose a Type.
- Choose a Form element. Text field is usually fine for simple data like this.
- Click Save to save your changes.
- On the next page, you’ll be given quite a few additional settings for how your new field will behave.
- When you’re finished with these settings, click Save field settings to continue.
That’s all!