Chapter 6. Basic Content

Everything we have dealt with so far, as important as it may be in terms of creating our own unique site, must take a back seat when it comes to the topic of content and content management in Drupal. After all, content is what this is all about! With the explosion in the number of sites offering dynamic content, it is now an absolute necessity to provide meaningful, dynamic, and relevant information on your site in order to prosper. How this is done behind the scenes is really of no concern to a site's users, but if you can make their browsing experience hassle free and relevant to them, they will stick with you.

What does hassle free mean in this context? Content needs to be easy to find, which in turn means it needs to be well organized. It needs to be well presented and easy to interact with—in other words, simple to use. Most of this is taken care of already by Drupal, and for very little additional effort, we can provide some very powerful functionality. However, before we look at adding more functionality, we should really ensure that we have a good grasp of how to use what is already in place.

To this end, this chapter will provide a good grounding in the basics of content management before it moves on to look at a few interesting and powerful features of Drupal. Specifically, we will look at the following:

  • Content types
  • Working with content
  • Content-related modules

Once we are done here, it will be time to look at how to put together some neat pages using HTML and PHP, as well as the all important task of working out how to classify and categorize all your data to provide a sophisticated and intuitive content management system. All this is to come in the following chapter. For now, let's get on with familiarizing ourselves with Drupal and its content.

Content Types

You have already been exposed to some of Drupal's content types' structure and usage. This is actually fairly useful because it means we can spend time focusing on more important issues in lieu of giving a broader overview of content and content management in Drupal. That's not to say that everything in this section, and the one that follows, has already been covered, though.

For a start, we need to have a good idea of the types of content that can be created in Drupal, and then we need to look at the various ways these content types can be put to use. Knowing this will help you determine the best way to go about implementing whatever functionality you have in mind for your site.

The following table lists the content types that ship with Drupal by default:

blog entry

A blog, or weblog, is an author-specific content type that is used as a journal or diary, among other things, by individuals. In Drupal, each blog writer can, depending on the site's settings and their permissions, add attachments, HTML, or PHP code to their blog.

A good example of a blog can be found at: http://googleblog.blogspot.com/, which demonstrates an interesting use of the blog content format.

Book Page

A book is an organized set of book page types (actually any type can be used nowadays), which are intended to be used for collaborative authoring. Book pages may be added by different people in order to make up one single book, which can then be structured into chapters and pages, or in whatever structure is most appropriate, provided it is in a hierarchical structure.

Because pretty much any data type can be added to a book, there is plenty of scope for exciting content (think of narrated or visual content complementing dynamic book pages, created with PHP and Flash animations, to create a truly unique Internet-based book—the possibilities are endless!).

A good example of a book is the documentation provided for developers on the Drupal site, found at:http://drupal.org/node/316. This has been built up over time by a number of different authors.

You will notice that if you have the book module enabled, an additional outline tag is presented above all/most of the site's posts. Clicking on this tab allows you to add that post to a book—in this way, books can be built up from content posted to the site.

Comments

Comments are slightly different in that they aren't really nodes like the other types. In other words, you can't create a comment in the way that you create any other content. Instead, you can tack comments on to other content types, and these are very popular as a means to stimulate discussion among users.

You can see comments in action by logging in to the Drupal forums, http://drupal.org/forum , and posting or viewing comments on the various topics there.

forum topic

Forum topics are the building blocks of forums. Forums can only consist of forum topics and their comments, unlike books, which can consist of pretty much any content type. Information in forums is categorized in a hierarchical structure, and they are extremely useful for hosting discussions as well as community-based support and learning.

Forums are abundant on the Internet and you can also visit the Drupal forums to get a feel for how they operate.

page

The page type is meant to allow you to add basic, run-of-the-mill web pages that can be found on any site. About us or Terms of use pages are good candidates for the page type, although you can spruce these up with a bit of dynamic content and HTML.

Just look on any website to see examples of such pages.

Content Type

Description

poll

The poll type provides the facility to ask questions, and supply a set of answers that are then presented in graph format. Many different enterprises make use of polls in order to collect political or marketing information, or to conduct research, among other things.

Polls by nature generally have a limited life span; so you will have to search for your own examples. Many news sites such as Time magazine conduct polls to determine public opinion; so these may be your best bet for seeing how polls can be put to good use.

story

A story page is more or less the same thing as a standard page type. However, you might want to distinguish the two by using story types for short-lived pages, such as news or notices.

The following table looks at some of the content types that are available as contributions:

Content Type

Description

Acidfree

Albums and media item types provided with the Acidfree contribution allow you to work with image and video content. The contribution also provides facilities to manage your media files.

Daily

The daily contribution provides two new node types, called daily item and daily container. These are used to facilitate browsing of content items by date, or even controlling when content items are made available on the site in the future.

Flexinode

This contribution allows users to define and edit their own content types.

Front Page

While not technically a node/content type, Front Page does allow users to create a front page, which does not have to conform to the standard page layout of the rest of the Drupal site. Useful if you would like to add an introductory page to your site.

Every time you create new content for your site, there are several options available for you to make the appropriate decisions over, and these are displayed in the list that appears below the body of the post. Depending on the permissions of a given user, they will also have some, although hopefully not all, options available to them. For example, if upload permissions are enabled for authenticated users, then they will be able to decide whether to attach a file to any content they create.

As the administrator, your powers are more substantial; so let's go through the default options available when creating a standard page content type. Be aware that different types of content may also have additional options available for them. For example, if you create a new poll, you will have to decide how long the poll is to run for by setting the Poll duration in the poll type's unique Settings section.

The content options discussed in the following section are representative of most types.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.94.249