Zend Training
In previous lessons we learned how and when to utilize the Page, Story and Book content types. There is another content type installed with core modules in Drupal called the Blog Module. This content type is used to create what's known as a web 2.0 experience. Web 2.0 is an interactive collaborative discussion between the author of an article and numerous registered and anonymous visitors to the site. There are two parts to the Blog feature in Drupal, the Blog Module and the Blog API Module. The Blog API Module is optional and allows for posting of Blog content via third party applications through the XMLRPC protocol built into Drupal. For now let's go ahead and enable the Blog Module.

We'll need to be logged into Drupal with an administrator account to enable new modules. On the navigation menu select Administer.

Drupal Administrator Navigation

The Administer section is divided up into five major task categories; Content management, Site building, Site configuration, User management and reports. Within the Site building task category, we want to select Modules.

Drupal Site Building Modules

The Modules page will display two collapsible menus (Core - optional & Core - required) listing the available modules, version, description and whether or not they are currently enabled. Note: Later when we learn how to download and install more modules we will see this list grow with more collapsible menus.

Go ahead and enable the Blog Module in the Core - optional section. All modules will always be in alphabetical order with the collapsible menu. Scroll to the bottom of the page and hit the Save configuration button.

Drupal Blog Module

If we select Create content in the main navigation bar we should see a new available content type listed, Blog entry. There will not be any obvious changes between Blog entry and the other types of content types we've looked at so far. The only four notable things are:

  • Comment settings enabled by default
  • When a Blog entry is published and viewed, the Author and timestamp are displayed
  • Each Blog will be organized by the Author
  • Content can be added or edited via Blog API module through third party software or iPhone.

Drupal Create Content Blog

Let's go ahead and create a new Blog entry. To keep things simple, for now we'll just enter a Title and a few words to the Body of the content. Scroll to the bottom and click the Save button. We should get an informative green message on top stating that the blog entry has been created. Hit the reload button on your web browser to get rid of this message. We should see the breadcrumb's navigation organized by Blog Author now and and Add comment option below the Blog post.

Drupal Blog Add Comment

While you are logged in, try to add a Comment. By default, Comments will need to be previewed and saved in two steps. The Subject field is optional, but the Comment field is required (as indicated by the orange asterisk). After typing in a suitable comment, hit the Preview button.

Drupal Blog Add Comment Entry

The comment will be shown in a yellow preview window. If we approve, we can go ahead and click on the Save button. This Comment and each subsequent Comment afterward will be appended below the Body of the Blog entry.

Drupal Blog And Comments Display

It is important to note that by default, new comments are displayed in a stack style, where the newest Comment goes on top of the older Comments. To change the order to reverse, goto.. Administer, Content management, Content types.... in Blog entry select edit in the Operations column. Then click the Comment settings collapsible menu to reveal Default display order:, click the option "Date - oldest first", then click the Save content type button. Other configurable options in this screen include the ability to opt out of Comment preview, subject line in the Comment and settings for handling of Anonymous commenting.

Now that we have a couple Comments posted on our Blog entry, the only problem is that they are not viewable by anonymous visitors to our website. We'll need to edit permissions in Drupal to make Comments viewable by everyone. goto.. Administer, User management, Permissions.

Drupal Permissions

Under the comment module section, turn on the check for access comments in the anonymous user column and click the Save permissions on the bottom of the screen.

Drupal Enable Anonymous Comments

If we open the Blog entry in another web browser we should be able to see the Comments even though we are not logged in.

This concludes our overview on the Blog Module.