
Node Content types—the Story
Drupal comes with two predefined Node Content types: Story and Page. Let's begin by working with a Story.
Drupal defines a Story as being:
The definition mentioned above isn't really a precise definition. This is because if we accept it, then we can infer that the other Node Content type must be the one that bores the life out of visitors!
With its default settings, a Story is designed to be the type of page content that the visitor has come to the site to read. If not overridden, this will become part of the pool of Node Content from which the front page (home page) is composed. Additionally, visitors to the site will be allowed to post comments about the Story. Personally I feel that 'Article' or 'Piece' would have been a more descriptive name than 'Story'. Drupal allows you to name the Node Content types—even the predefined ones—anything you want. Therefore, if you feel strongly about the name of a Node Content type, then change it!
Note
The 'home page' of a Drupal site is called the 'front page', in keeping with a newspaper. Unlike a typical web site, where this page content remains relatively unchanged, the default for a Drupal site is that the front page self-composes from available Stories, as well as any Node Content that has been 'promoted'.
This is a good time for an activity, and as luck would have it, our project site needs a new Story. Let's create one.
Activity 2.1: Creating a Story
We're going to create a Story to use on our project site's front page. The Story will be used to promote a new CD. You can feel free to alter the subject to anything you feel comfortable with, by knocking out a couple of paragraphs.
Although you can use Drupal to compose your Story or any other Node Content, which is something that we'll do in another activity, many people prefer to compose 'offline' in their favorite text editor, and then later copy and paste that content into Drupal. We'll use that method in this example.
- Open your favorite text editor and type a few lines to promote a new CD. If you're not feeling creative, then feel free to just copy the text used below. I'll use WordPad (shown here in the screenshot) as the editor, but any text editor will do.
- Copy the text.
- Log in to the Drupal admin panel. Select the Create content option from the choices that appear, as shown in the following screenshot.
Tip
Drupal allows a theme to be set for the admin pages that is different from the site theme. This is a great way to avoid ever being confused about where you are. You can do this setting by selecting the Administration theme from the Site configuration menu, or by going to http://yourdomain.com/admin/settings/admin_menu.
- The Create content page (seen in the upcoming screenshot) lists the Node Content types defined for the site, along with a description of each. If you're looking at the screen and wondering why it looks different, then it is because you're seeing the site theme at this point, although the admin links will still be listed in the left column as long as you are logged in. You can see this in the screenshot, and, in fact, this template being used for the site also creates a black header of admin links. It is located below the main header when on the front page, and would not be present for anyone not logged in as an admin. If no custom Node Content types have been added, then there will be only two types listed: Story and Page. Our project site actually has a few extra types. You're going to create a Story, so click on this link to begin.
- Having clicked on Story, you will see a form, as shown in the next screenshot, which you will soon come to know very well. There are a number of fields on the form that are hidden from view, and that have links to toggle their visibility. That's fine, because at this point, we only want to work with the fields that are initially visible. We'll look at them in more detail shortly. Enter the Title Music For Your Spleen in the first field (don't give it much thought; you can change it at any time).
- The next field is the Body. Everything that is contained in this field becomes the page content for this Story. This is where we will paste the text that we created in the text editor. Click in the box, and then use any method that you normally use for pasting text, whether it's the browser menu, mouse click, or a keyboard shortcut. The text that we entered will now appear in the Body field. At this point you can click on the Save button at the bottom of the page.
You've done it! That wasn't bad at all, was it? We can now see the Story as a live page. Drupal automatically 'trims' the content to a certain character length, and displays it on the front page. It then inserts a link to read more, which when clicked on, takes the reader to a page where the content area is the Node Content in its entirety. The default trim length is 600 characters, but this value can be changed. In our project site, the trim length is set to 400 characters.
The new Story will immediately appear on the front page. This is due to the default setting for Stories, which publishes them to the front page. Whenever you save Node Content, Drupal redirects you to the actual page.

Looking at our story, there are a couple of simple formatting changes that can be made to the text in order to improve its appearance, and some minor corrections that need to be made, as well. It's time for our next activity.
Activity 2.2: Editing Node Content
We're now going to edit the story that we have just completed, and make some simple changes directly to the text. Depending on the user's permissions, the Node Content type, and other factors, editing the Node Content body will be done either in a Rich Text Editor, which we'll do in the next activity, or directly to the raw text, which we'll do now. Not all input types, Node Content types, or sites offer Rich Text editing. Therefore, learning to do it the 'old-fashioned' way is worthwhile; it is similar to learning to do long division, but much less painful.
We're still looking at the Story that we have created. Above the Story's body are two tabs (sometimes there will be more, depending on the settings): View and Edit. Click on the Edit tab, and the Edit page will appear with the Story in the Body box.
- Let's make the corrections first:
- Change the F in For in the title to lowercase.
- Do the same in the first line of the body.
- Remove the quotation marks from around the CD title in the first line of the second paragraph.
- Change addrss to address in the first line of the final paragraph.
- Change to usable to is usable in the same sentence.
- We're going to italicize both instances of the CD title. Before Music we'll put
<em>
. This is an opening HTML tag. There will be a matching closing tag. Not all HTML tags come in pairs, but those that format text usually do. The<em>
tag stands for emphasis, and will italicize the text following it, unless some other formatting is defined for the tag pair.We'll put the closing tag
</em>
, following Spleen in the first instance of the title, and another after Medicine in the second. Note that the slash in</em>
is a forward slash. - We'll put a pair of tags around the artist's name too. Put
<strong>
before Frank, and</strong>
after Bozak. If not redefined, then the<strong>
tag makes the text following it bold. - In the following screenshot, we see the body text as it should appear after editing.
- Click on the Save button, and the Story will be shown with the edits applied, as shown in next screenshot.
We glossed over the fields on the Content creation page before, but we should take a closer look at them before we move on to the next Node Content type and learning activity.
Content creation form fields
The form used for creating Node Content contains several links on it that, when clicked, reveal settings that you can alter. The state of these settings when you first load the page will depend on the default settings for that particular Node Content type, and whether those settings have been changed for this piece of Node Content or not. Each Node Content piece can have customized settings.
- Title: The first field is the page title. This is the only required field on the form. Once this field has an entry, you can save an empty Story or Page as a placeholder. When choosing existing Node Content to edit, use a title that you will recognize, because you will have to choose from a list of titles.
- Menu Settings: The menu settings are used to create a menu link to the Node Content. If you have a menu item specifically for a piece of Node Content, then you can create that link here, or, if you prefer, in the menu editor. If this piece of Node Content will be reached via other Node Content or as a front page random selection, but not via menu navigation, then these fields can remain blank.
- Menu link title: This is the text that will appear on the menu.
- Parent item: This drop-down lists all of the eligible menu items on all of the existing menus. A 'Child' menu item is an indented sub-menu choice to a 'Parent' menu item, and this item will become a child item of whichever one you select.
- Weight: If there are other Child items for the Parent item that you select, then these will appear in alphabetical order with other items of the same weight. 'Weight' is simply a numerical value, and if the items are sorted by weight rather than by, let's say, name or by creation date, then they will appear in the order that the weight values determine.
- Body: The text and tags that comprise the content.
- Input format: The input formats dictate which HTML tags are usable for input, and the filtering and actions that are performed (when the content is displayed) to enforce them. They are defined on the admin Input formats page, which is part of the Site configuration section. Input formats can be allowed or disallowed for specific user types. There are three pre-loaded types of input, of which the first two are enabled by default.
- Filtered HTML (default): This filters out all but the most basic HTML tags, thus allowing only basic formatting of the content.
- Full HTML: This input type allows all HTML tags, and thus enables the highest level of formatting.
- PHP Code: This is enabled if the PHP filter module is activated. It allows PHP script snippets to be inserted into the content. This, in turn, provides access to the system variables, as well as to content that is external to Drupal.
Note
PHP input should only be allowed for trusted programming experts. Not only can it accidentally damage the layout, but also when abused intentionally, it can destroy your site.
- Revision information: This is used in a similar fashion to a word processing program, to create a revised version of an article, and to record comments about the revision for other content creators to see.
- Comment settings: This determines whether site users will be able to submit comments about this Node Content. Depending on your settings, submitted comments will either be displayed immediately or only following an approval.
- Disabled: There will be no comment link shown
- Read Only: Existing comments will be displayed
- Read/Write: New comments will be accepted
- URL Path Settings: This is present because the Path module has been activated. The contents of this field will be used as the URL for this Node Content. Using this feature requires that the Mod-Rewrite option be enabled and configured for your Web domain. These paths are considered 'friendly' URLs, because they are much more meaningful to the site visitor, and are usable by search engines, because they will often contain terms related to the content, rather than identification numbers, and so on.
- Authoring information: This stores information about the author of the Node Content, and will be displayed if the site is configured accordingly. This setting can be changed in the Global settings section of the admin | Themes page.
- Authored by: This contains the username of the author of the Node Content. This field will default to the user creating the Node Content. Often, Node Content is created on behalf of someone else. The user name can be changed. This field has auto-complete enabled, so you only need to type the first character or two of the username. Leave the field blank to have an anonymous author.
- Authored on: This defaults to the date and time that the Node Content was created, but can be overridden. This information will be used for sorting in relation to other Node Content, as with, let's say, blog entries.
- Publishing options: These options specify how the Node Content is used.
- Published: The Node Content will be available to be viewed.
- Promoted to front page: The Node Content is available to be selected as material for the front page, and will appear there if it is newer than other promoted Content.
- Stick at top of lists: The Content will remain at the top of the lists of Node Content, such as on the front page.