By David - Posted on 03 August 2008

Begin by going to Administer > Content management > Content types (admin/content/types) and clicking the "Add content type" link at the top of the page.

  1. For Name enter: Article
  2. For Type enter: article
  3. If you'd like one, enter a Description for your own reference.
  4. Click to expand the "Workflow settings" fieldset and uncheck the Promoted to front page option.
  5. Press the "Save content type" button.

Adding custom fields

The custom fields will include article_teaser_text to serve as a custom-written teaser which will be displayed only in the context of teaser views of the content but not on the full article, and article_subtitle, which is a sub-title about the article that will only be shown on the full version of the page but not in the teaser. You can of course add as many additional fields as you need.

Adding field: article_teaser_text

  1. From the main Content types page, click the "add field" link to the right of your Article content type.
  2. For Field Name enter: article_teaser_text, and for Label enter: Article Teaser.
  3. For Field type, choose Text and press "Continue".
  4. On the following screen set the Widget type to Text field, and press "Continue".
    Note: if you prefer a multiple-line field with the possibility of adding HTML formatting with your WYSIWYG editor (e.g. FCKeditor or TinyMCE) to the text in your field, you can instead choose Text area (multiple rows). Keep in mind that with most WYSIWYG editors, setting a text field to be "multiple rows" usually activates the editor on that text area, which is probably excessive in this case (though your WYSIWYG settings page may allow you to selectively disable these). Generally for a small text field of this sort I don't recommend HTML, and especially not WYSIWYG. If you change your mind you can always adjust this setting later.
  5. In the "Global settings" fieldset, check the Required option, and enter a number for Maximum length such as 100 (it's usually ideal to set a maximum number of characters for the teaser to ensure it fits within the area you allot to teasers in your theme, and to enforce keeping teasers short and to the point for your readers). It's worth noting that Maximum length can only apply to a Text field kind of field -- the HTML textarea tag that the Text area (multiple rows) option creates is not capable of having a maximum length set (which is a limitation of HTML itself, not Drupal - you can however impose a maximum length on this tag using JavaScript).
  6. If you want to be able to use HTML formatting in your teaser (with or without a WYSIWYG editor installed), change the Text processing option to Filtered HTML (again not recommended, as the HTML counts towards the character limit, not to mention the purpose here is just a short bit of teaser text so ideally it should be kept simple... save the fancy stuff for the full article).
  7. Press the "Save field settings" button to complete the addition of your custom field.

Adding field: article_subtitle

  1. Since you are still editing the Article content type, click the "Add field" link at the top of the page to begin adding the next field.
  2. For Field Name enter article_subtitle, and for Label enter Article Subtitle.
  3. For Field type, choose Text and press "Continue".
  4. On the resulting screen set the Widget type to Text field, and press "Continue".
  5. If you wish to always require a Subtitle, then click the Required option, but you can choose to make this optional if you prefer.
  6. As with the first field you added, follow the same guidelines above regarding Text processing and Maximum length, and then press the "Save field settings" button.
  7. Lastly, the 2 custom fields are most likely not in their correct order at this point, so grab the arrow icon next to the fields to drag them to the position you prefer and press the "Save" button.
    Note: the positioning here is only important regarding how you wish the content entry fields to appear while you're creating new Article content. The order/placement in which they are shown on the page for site visitors can be completely different and is easily controlled in your theme, which we'll get to a bit later.

Setting up how the fields "Display" (on the full page)

  1. Click on the "Display fields" link at the top of the page (if your content type is named "Article" as in this guide, this will take you to admin/content/node-type/article/display).
  2. For Article Subtitle, set Label to Hidden, Teaser to Hidden, and leave Full Node set to Default.
  3. For Article Teaser, set all options to Hidden (the reason for this is because this field will "only" ever be used within the context of Views module, which will call it up in its own way, so we want to hide it in every other case).
  4. Press the "Save" button.