Chapter 1. Introduction to Drupal

This chapter provides a basic overview of what a content management system (CMS) is, how Drupal fills the role as a CMS, the major building blocks of Drupal, and how to create content on your new Drupal website.

Content Management Systems

In its simplest form, a CMS is a software package that provides tools for authoring, publishing, and managing content on a website. "Content" is anything from a news story, a blog post, a video, a photograph, a podcast, an article, or a description of a product that you are selling. In more general terms, content is any combination of text, graphics, photographs, audio, and video that represents something that visitors to your site will read, watch, and hear.

A CMS typically provides a number of features that simplify the process of building, deploying, and managing websites, including the following:

  • an administrative interface

  • a database repository for content

  • a mechanism for associating information that is stored in the database with a physical page on the website

  • a toolset for authoring, publishing, and managing content

  • a component for creating and managing menus and navigational elements

  • the tools required to define and apply themes

  • user management

  • a security framework

  • Web 2.0 capabilities such as forums, blogs, wikis, polls, and surveys

  • taxonomy and tagging

  • online forms

  • e-commerce capabilities

There are hundreds of CMSes available (check out www.cmsmatrix.org). They range from simple blogging-only platforms, such as WordPress, to complex enterprise class content management solutions, such as Drupal.

Drupal

Drupal is a free and open source CMS written in PHP and distributed under the GNU General Public License. Drupal stems from a project by a Dutch university student, Dries Buytaert. The goal of the project was to provide a mechanism for Buytaert and his friends to share news and events. Buytaert turned Drupal into an open source project in 2001, and the community readily embraced the concept and has expanded on its humble beginnings, creating what is now one of the most powerful and feature-rich CMS platforms on the web. Individuals, teams, and communities leverage Drupal's features to easily publish, manage, and organize content on a variety of websites, ranging from personal blogs to large corporate and government sites.

The standard release of Drupal, known as Drupal core, contains basic features that can be used to create a classic brochure website, a single- or multi-user blog, an Internet forum, or a community website with user-generated content. Features found in Drupal core include the ability to author and publish content; to create and manage users, menus, forums, and polls; and to manage your site through a web browser-based administrative interface.

Drupal was designed to be enhanced with new features and custom behavior by downloading and enabling add-on modules. There are thousands of additional modules (known as contributed or 'contrib' modules) that extend Drupal cores functionality, covering a broad spectrum of capabilities, including e-commerce, social networking, integration with third-party applications, and multimedia.

Drupal can run on any computing platform that supports both a web server capable of running PHP version 5.2+ (including Apache, IIS, Lighttpd, and nginx) and a database (such as MySQL, SQLite, or PostgreSQL) to store content and settings.

Drupal Core

When you download and install Drupal, you are installing what is commonly called as Drupal core. Core represents the "engine" that powers a Drupal-based website, along with a number of out-of-the-box features that enable the creation of a relatively full-featured website. The primary components of Drupal core include capabilities to create and manage

  • content

  • file uploads/downloads

  • menus

  • user accounts

  • roles and permissions

  • taxonomy

  • blogs

  • discussion forums

  • online polls

Drupal core also includes a feature-rich search engine, multilingual capabilities, and logging and error reporting.

Contributed Modules

Although Drupal core can be used to build feature-rich websites, there are likely situations where core lacks the functionality needed to address specific requirements. In such cases, the first step is to search through the thousands of custom modules contributed by developers from all around the world to the Drupal project for a solution that meets your needs. It's very likely that someone else has had the same functional requirement and has developed a solution to extend Drupal core to provide the functionality that you need.

To find a contributed module, visit the Drupal.org website at www.drupal.org/project/modules. You will find a general list of categories and the current number of contributed modules contained within each. Here is a short sampling of the types of categories and the number of modules you can find in each:

  • utility (926)

  • content (900)

  • content display (853)

  • third-party integration (816)

  • administration (557)

  • Content Construction Kit (CCK) (420)

  • developer (398)

  • community (359)

  • media (331)

  • e-commerce (316)

A few of the most popular modules, and the ones that you will likely want to install, include:

  • Ubercart: A full-featured web storefront module that provides all of the mechanisms required to sell products (physical as well as electronic downloads), collect credit card payments, and manage shipments. If you want to sell something on your website, this is the module you will want to use.

  • Webform: A module that provides a simple to use mechanism for creating, publishing, and managing forms (such as for a volunteer application, or an "ask us" or request more information form). There's no programming involved in creating online forms; any user with a basic understanding of how to create content in Drupal can quickly master the creation of simple to complex forms.

  • Views: This module provides a simple to use tool for extracting information from the Drupal database and displaying the results on your website. Views is extremely powerful and can be used for things like displaying events on a calendar, creating a photo gallery, creating a slideshow, creating a table that lists various attributes of content (such as the title, author, date published, taxonomy terms, the body of the article, and so on).

  • Panels: This module provides the ability to create complex page layouts without having to create code. There are several predefined layouts (rows and columns), as well as flexible layout that allows you to define your own custom layout.

  • Date and Calendar: These modules provide the ability to create and manipulate date fields, as well as rendering a list of events on a calendar.

  • Content Construction Kit (CCK): CCK provides the ability to create custom content types in Drupal. In Chapter 2 I discuss the two basic content types that come with Drupal 7: the story and the page. There will likely be other types of content that you want to capture on your site: content that contains additional fields beyond just a title and the body of the article. An example of a custom content type might be an event, where an event has a title and description (body) plus fields for capturing the start date/time, end date/time, the location, the price, and a description of the method for acquiring a ticket. CCK provides the mechanisms you will need to create and manage custom content types on your website.

  • Backup and Migrate: Handles scheduled backups of content in your Drupal database, with the ability to restore the database to a previous state based on one of the backup files created by this module. This is a must-have module for any production website.

  • Google Analytics: Provides a simple to use form for setting up Google Analytics on your site. Google analytics is a free service that tracks the number of visitors to your website, where those visitors came from, what search terms they used to find your site, the pages they visited while on your site, how long they spent on your site, and many other useful metrics that will help you view and understand the usage of your website. For more information on Google Analytics, please visit www.google.com/analytics.

  • ImageCache: A tool that automatically resizes, scales, and crops images on your website. A must have for any site that uses pictures that are uploaded by users. ImageCache will take, for example, a 4MB picture that was uploaded from a digital camera and automatically resize that picture to a predefined, web-friendly size, such as 200px by 200px, thereby reducing the overall file size significantly and speeding the page loading time.

  • IMCE: A simple to use, web browser-based file manager that enables file uploads and downloads to and from your server.

  • Pathauto: This module creates search engine-friendly URLs by automatically generating a "pretty" URL that is based on the page's title (such as www.drupal7book.com/examples instead of the default Drupal URL of www.drupal7book.com?node=1234.

  • Scheduler: Provides the ability to specify the date that a node will become published on the site, and the date when a node will no longer be published. This allows a content author to create a node now and have it not appear on the site until some date in the future.

  • WYSIWYG: Provides a simple to use feature for downloading, installing, and configuring "what-you-see-is-what-you-get" text editors.

Drupal Themes

A theme is the Drupal component that defines how the pages on your website are structured and the visual aspects of those pages. A Drupal theme defines attributes of your website such as:

  • How many columns of information will be presented on a page (a 3-column layout with a left, center, and right column; a 2-column layout with a narrow left column and a wide right column for content; a 1-column layout, and the like).

  • Whether a page has a banner at the top.

  • Whether a page has a footer.

  • Where navigational menus appear (at the top of the page, under the banner, in the right column, and so on).

  • The colors used on the page.

  • The font and font size used for various elements on a page (such as headings, titles, and body text).

  • Graphical elements, such as logos.

Drupal core includes a number of off-the-shelf themes that you can use for your new website. You may also download one or more of the hundreds of free themes that are available at www.drupal.org/project/themes, or create your own theme by following the directions found at www.drupal.org/theme-guide.

Creating Content

A website without content would be like a book without words, a newspaper without news, and a magazine without articles: hardly worth the effort of looking at. Drupal makes it easy to create, publish, and manage content on your new website. Let's look at how simple it is by creating our first piece of content. If you haven't installed Drupal yet, please visit the Appendix and follow the step-by-step process for installing and configuring Drupal core.

There are multiple paths for getting to the content-authoring screens in Drupal. I'll focus on the simplest first, and then discuss other methods in Chapter 2.

On the front page of your new website, you will see an "Add new content" link in the Welcome article on your home page. In the left-hand column, you will also see an "Add new content" link in the Management menu (see Figure 1-1). Click either of the links: they both take you to the content editing form where you will create your first piece of content.

Click either "Add new content" link to get started

Figure 1-1. Click either "Add new content" link to get started

Next you'll see a listing of the content types that you can use (see Figure 1-2). Drupal 7 comes with two basic content types: an article and a basic page. Both content types provide you, the author, with a text field for entering the title of the content item, and a body text area where you can write. Different content types provide additional elements. In the case of an article, you have the ability to enter "tags" for categorizing your content. I will cover tagging and several other content types later in the book, as well as the capability for creating your own custom content types.

Select your content type

Figure 1-2. Select your content type

Start with the simplest content type – a page – as the basis for your first content item on your new website. Click the "Basic page" link, which opens the content creation form for creating that content type (see Figure 1-3). On this form, enter the title of your first article and some text into the body area. After you have entered the title and body of your article, scroll down to the bottom of the page. On the left side of the screen you will see a vertical menu with several options. Click the "Publishing options" tab (I will cover the other options in Chapter 2), and check the Published and "Promoted to front-page" boxes. By checking the Published option, the article will be immediately displayed on your website the moment you click the Save button. Checking the "Promoted to front-page" box instructs Drupal to automatically display the article on the homepage of your new website.

Creating a basic page

Figure 1-3. Creating a basic page

Next click Save. Drupal will insert your new page into the database, and will then automatically redirect your browser to the homepage of your website, where you will see your new article (see Figure 1-4).

Voila, you are published

Figure 1-4. Voila, you are published

Congratulations! You've authored and published content on your new Drupal website. There are many other content authoring, publishing, and management features that I will cover throughout the remainder of this book. You are well on your way to building incredible websites on Drupal.

Summary

This chapter focused on the basics of what a CMS is, the base functionality available in Drupal core, how to extend the functional footprint of Drupal core by adding contributed modules, Drupal themes, and creating your first content item in Drupal. Chapter 2 will dive deeper into the content creation, publishing, and management capabilities of Drupal 7.

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

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