In Drupal, there is a concept of a front page, which will be the page shown whenever your site is accessed with the value that you gave as the $base_url, with no further path information. At the moment, with your freshly installed Drupal site that has no content, this front page will show the following message:
Welcome to your new Drupal-powered website. This message will guide you through your first steps with Drupal, and will disappear once you have posted your first piece of content.
As it states, this message will no longer appear as soon as you add some content to your site. So let's do that now!
The content you create will be promoted to the front page and replace the default message. This is Drupal's default behavior (you will see how to modify this behavior in Chapter 2).
Drupal has two types of content enabled by default, and several other types that can easily be turned on. The two default content types are pages and stories. These two content types represent the most basic form of content in Drupal. Both consist of a title and a body used for the main content. Pages have an extra Log message field, which is intended to be used by the author to keep notes or comments about the content being created. Pages are the Drupal equivalent of static pages for brochure sites. Stories can be used for content on news sites or for journals where content is created regularly, and visitors are likely to be interested in the latest news. You might also create stories if you want to use Drupal as a single-user blogging site.
To add a news story to your new site, click the create content link in the main navigation menu. This will bring you to a page that lists all of the various content types that can be created. By default, the choices are page and story types.
Click the story link to create a new story. Give the story a title, write some text in the Body field, and click Preview to see what it will look like when published. Keep editing the text and previewing it until you are satisfied, and then click Submit.
When you click Submit, the story is saved to the database and published. In Chapter 2, you will see how to change the workflow so that content isn't published immediately. By default, Drupal allows you to use only a restricted set of HTML tags in the text. This is a function of the filter system, which is also covered in Chapter 2.
Congratulations, you've just created content with Drupal! Figure 1-5 shows an example of a test story.
Notice the two tabs on the story page: View and Edit. These appear only to people who have permission to edit the story, which by default is the superuser (user 1) or the person who created it. If you click the Edit tab, you can edit the story, or even delete it. If you log out and view the story as an anonymous user, the View and Edit tabs will no longer appear.
You will also notice that you can add comments to this story. Once again, this is the default configuration. Chapter 2 describes how to turn off the comments for either a single post or for an entire comment type.
Now let's look at the site's front page again. Click the Drupal icon or the Home link to return to the front page. Instead of the default message introducing you to your new site, you see a view of the story you just created. If you entered longer text for the body of the story, it will have been shortened on the front page. The shortened view of a post in Drupal is called a teaser.
The front page is a listing of recent content that has been added to your site. If you add several more stories or pages, they will all be listed on the front page in reverse chronological order, from newest to oldest.
With Drupal, you can control what content should be used as the front page. While the default system of showing a list of recent content will work for some sites, others will want to have a "Welcome" type front page. You can make a page like this by clicking create content and creating a page that you intend to be used as the front page. Alternatively, click the link to one of the stories that you've already created if you would like it to be the front page. Once you have completed the page and are looking at the final product, note the URL for the page. It will look something like this:
You might have noticed already that all the individual postings have URLs that are similar to this. The first one you made is node/1, the second is node/2, and so forth. Determine which node number you just created—the one you intend to be the new front page. Perhaps it is node/7, as in the example here. If so, Drupal considers the path to that page to be node/7. This is the part that you will need to know, so make a note of it.
Test story view edit
Your story was created.
Submitted by admin on Mon. 10/03/2005 - 16:56.
Hello World, this Is a story. » add new comment
Now navigate to administer> settings. This is the site settings page (covered in depth in Chapter 2). Here, you can tell Drupal which path to use as the front page. In the General Settings group, find the Default Front Page field. It has the value node, which to Drupal means a list of recent content. Change that to whatever posting number you created to be the front page (node/7 in the previous example), and then click the Submit button at the bottom of the site settings page. If you visit the front page now, it will show the page that you made.
Was this article helpful?