Your First Drupa Website

WHAT YOU WILL LEARN IN THIS CHAPTER:

> How to create an Article (news story or blog entry)

> How to create an About Us page

> Adding the RSS (Syndication) block to your sidebar

> Enabling and configuring your Contact Form

> Modifying site permissions to create a members-only website

> How to create new user accounts

> Selecting a new theme

> Downloading and installing a new theme

> Configuring Cron

Quickly get up to speed on your new Drupal website by following along with this chapter. In this overview, you will create content, enable the contact form, add blocks to the left and right sidebars, and explore your site's permissions. At the end of this chapter, you'll have a fully functional website. You will also have explored the most common administrative functions and settings.

The topics covered in this chapter are done at a high level to quickly introduce you to the various administrative areas of Drupal. Once you feel comfortable with the exercises performed in this chapter, you'll be ready to move on to the subsequent chapters that cover these areas, functions, and settings in greater depth.

ADDING CONTENT

You have a message. You want to be heard, or maybe your client does. In either case, one of your first steps will be to add content to your site. Drupal's default installation provides two types of content: Articles and Pages. Both of these items are known as nodes in Drupal's terminology. The concept of a node is important to understand because nodes share a common set of attributes and features. For example, all nodes can receive comments and be available in RSS feeds. Also, other modules can add features to nodes, extending a node's functionality. An example of this is the contributed Fivestar module, which adds the ability to rate content.

In the following two exercises, you'll explore the differences between an Article node and a Page node. One of the first things you should notice is that the Article and Page creation page look nearly identical, with just a few differences. After the exercises, it should be apparent why this is.

TRY IT OUT

Creating an Article Entry

This exercise walks you through the steps to create an article entry.

Log into your website as an Administrator.

Click Add Content in the top menu as shown in Figure 3-1.

Click Article under Add New Content.

On the Create Article screen, type in the following information as shown in Figure 3-2:

Dashboard XContent Structure Appearance

Add content Find content Dashboard

FIGURE 3-1

Title: Hello world!

Tags: first post, introduction

Body: Hello world this is my first article. How are you?

(optional) Upload an image to be shown within the article.

Click the Save button at the bottom of the page.

FIGURE 3-2

How It Works

An Article is a node type, also known as a content type in Drupal. Articles are typically used for news, updates, and other constantly changing content. Articles, like all nodes, are created through the Add Content screen. Every node type shares a common set of attributes, although they vary in their defaults and where and how they appear on the website. This will become more apparent after the second exercise.

I Creating an About Us Page

This exercise walks you through the steps to create an About Us page.

1. Click Add Content in the top menu as shown previously in Figure 3-1.

2. Click Page under Add New Content.

3. On the Create Page screen, type in the following information as shown in Figure 3-3: > Title: About Us

^ Body: As a new website we provide our readers with excellent and fresh content.

4. Click the Save button at the bottom of the page. How It Works

FIGURE 3-3

Pages are the static pieces of your website that are typically reserved for site necessities such as About Us, Directions, or a copyright notice. The Add Content screen is similar to that of an Article, because both items are nodes.

Differences between Articles and Pages

If you compare the Create Article screen (Figure 3-2) and the Create Page screen (Figure 3-3), the first difference you will see is that an Article has an image upload form and allows for Tags (categorization). Pages only have a title and body. This is simply a Drupal default. A Page can be modified to have Tags or its own categorization system, pages can also accept images or file uploads. You will learn how to modify these settings in Chapter 6, "Content."

Now compare the lower portion of each screen as shown in Figure 3-4 and Figure 3-5.

Create Articfe

Title -

Hello Worldl

Tags first post, introduction,

Enter a comma-separated list of words to describe your content. Full text (Edit summary) Hollo work! this is my first artlde How are you?

Menu settings

1 1

Revision information

URL path settings f CommentN ( settings J

Authoring information

Byjreddirg f 'ublishing

V Published. Promoted^ \to front page S

The link text corresponding to this item that should appear in the menu. Leave blank if you do not wish to add this post to the menu.

Parent item

The maximum depth for an Item and all its children is fixed at 9, Some menu items may not be available as parents if selecting them would exceed this limit.

Weight

Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.

Save Preview

Save Preview

Create Page

About jo

Full text (Edit summary)

As a new website we provide our readers will excellent and fresh content.

Menu settings

Menu link title

Revi si on

The link text corresponding to this item that should

No revision

appear in the menu. Leave blank if you do not wish to add this post to the menu.

URL path

settings

Parent item

___

<Main menu> ^J

/Comment\

\Closed J

The maximum depth for an item and all its children is

fixed at 9. Some menu items may not be available as

Authoring information

parents if selecting them would exceed this limit.

By jredding

Weight

f Publishing^.

1° J

Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top,

Save Preview

Save Preview

FIGURE 3-4

FIGURE 3-5

Note that the Comment settings on an Article are set to Open, whereas the settings for a Page are set to Closed. The Publishing options also differ, with Article set to Published and Promoted to Front Page, and Page set only to Published. These defaults reflect how you want the respective pieces of content to appear on your site.

Nodes Are Content

If it hasn't become clear by now that Articles and Pages are both based on nodes, let it resound in your memory forever. Understanding the concept of a node is important when you want to add new types of content such as events, images, or videos to your website. In Drupal, you look for the functionality that you want to add, instead of a module that provides you with a specific content type. For example, the embedded media field module (http://drupal.org/project/emfield) adds the ability to insert Flickr photos, YouTube videos, Last.fm music, and many other forms of media directly into any node (i.e., content type) on your website. In Chapter 6, you will learn more about nodes, including how to modify their defaults and create your own content types.

Content Summaries

When creating your first article, you may have noticed the Edit Summary button (shown previously in Figure 3-1). A Summary is also known as a teaser, the part of the node that is shown on your site's frontpage. It is also used in your site's RSS feeds, tempting the user to click the Read More link. Clicking this link will display a new Summary box above the Full Text box as shown in Figure 3-6.

If you do not enter a Summary, the default set for each content type will automatically create one for you characters of your Article.

Summary {Hide summary)

Hello world welcome to m y first Article post! Click Read m ore to continue reading.

Leave blank to use trimmed value of full text as the summary. Body

Hello world this Is my first article. How are you?

FIGURE 3-6

By default, the summary is the first 600

Modifying the Defaults

So far this chapter has stated that you can change the defaults for nearly everything. But where should you start?

You can modify the defaults for each content type at Structure C> Content Types, as shown in Figure 3-7. Select Edit to the right of the content type you want to modify.

The following screen will display all the default options available for that content type. For example, you can configure the length of the summary under Display Settings, as shown in Figure 3-8.

Dashboard Content Structure Appearance People Modules

Add content Find content

Home » Administer

Structure o

Q Blocks

Configure what block content appears in your site's sidebars and oth

Q Content types

Manage content types, including default status, front page promotion

Q Menus

Add new menus to your site, edit existing menus, and rename and re Q Taxonomy

Manage tagging, categorization, and classification of your content.

FIGURE 3-7

Submission form settings

Publishing options

M Display post information

Enable the submitted by Username on date text.

Length of trimmed posts

600 characters

Display settings

Comment settings

Open, Threading, 50 comments per page

The maximum number of characters used in the trimmed version of content.

FIGURE 3-8

FIGURE 3-8

The default options and instructions on creating custom content types are covered in Chapter 6

NOTE Changes to the Display Settings will take effect on all new content created after the setting change, in other words this setting is not retroactive.

MODIFYING YOUR MENUS

Now that you have an About Us page, follow the next exercise to place a link in your top menu (Figure 3-9), to provide easy access for your site's visitors.

V V V ^ About us Directions Contact

My first Drupal site

1

User login

Hello World!

Username

L _J

Hello world welcome to my Article post? Click

Read more to learn more about this site

Password

Read more first post introduction

f Log in)

• Create new account

• Request new password

CT >Jil]+?W

FIGURE 3-9

FIGURE 3-9

TRY IT OUT

_ Modifying the Top Menu

This exercise walks you through adding the About Us page to the Administration menu.

1. Navigate to the About Us page you created in the previous Try It Out exercise. If you cannot locate this page, click Content in the upper-left corner.

2. Click Edit on the About Us page.

3. Scroll to the bottom of the screen and enter the following information as shown in Figure 3-10:

> Menu Link Title: About us

^ Parent Item: Select <Main menu>

> Weight: Select 0

4. Click the Save button.

How It Works

To save you time, Drupal provides a method to directly add a Menu link when you create or edit the node. You can also add new

FIGURE 3-10

Menu items by clicking Structure in the Administration menu. Go to Administer O Menus (under Structures) O Add Link next to the respective menu (in this case, the Main menu).

A WORD ON MENUS_

Drupal contains several menus by default, and you can create many more. As you have already seen, the Main menu is the menu displayed at the top of your site. Menus are also provided for administration, management, site navigation, and user account links. These are all explored in-depth in Chapter 5, "Administration— Blocks, Menus and Themes."

Review the following items shown in Figure 3-10:

Menu Link Title: The text that will appear to the site visitor (such as "About Us").

Parent Items: This drop-down box can be a bit confusing at first glance because it displays every menu and every menu link on your site. The key to deciphering this is as follows:

<menu name>: The < > indicates that this item is a separate and independent menu. Figure 3-11 displays two menus: Main Menu and Management.

-- : Two dashes indicate that the item is located underneath a menu. Each subsequent two dashes indicate than the item is a child of a parent. Article and Page are children of Add New Content and are located within the Management menu.

— Directions

FIGURE 3-11

Weight: Every link in a menu is first ordered by its weight and then alphabetically. Links with lower numbers are listed higher than the higher (heavier) numbers. To reorganize your links, just use the drag and drop interface in the Menu administration page.

Adding Blocks to Your Website | 33

ADDING BLOCKS TO YOUR WEBSITE

Blocks are the pieces of content that typically flank the left or right side of a website. Recent comments, latest users, a navigational menu, advertisements, or a box of RSS feeds are all examples of blocks. Figure 3-12 displays two blocks in the left sidebar region of Drupal's default theme: Search and User Login.

FIGURE 3-12

TRY IT OUT

Enabling the Recent Comments and Syndication Blocks

In this exercise, you enable a few useful blocks and explore the concept of Drupal's regions and blocks.

Log into your website as an Administrator. Click Structure in the Administration menu at the top of the screen, and then click Blocks.

Drag the Recent Comments block from the Disabled section to underneath the Right Sidebar. Do this by clicking and holding the cross symbol to the left of the block's name.

Recent comments Syndicate

Drag the Syndicate block from the Disabled section to underneath the Right Sidebar. Figure 3-13 displays how this should look. FIGURE 3-13

Click the Save button at the bottom of the page.

Right sidebar

Right sidebar

configure configure

How It Works

Blocks are placed within Regions on your site. A Region is defined by the site's theme, so each website may not have the same regions. Drupal's default regions are Header, Footer, Left Sidebar, Right Sidebar, Content, Highlighted Content, and Help. When you are on the Blocks admin page, you can see that each region is highlighted by a dotted border box with the name of the region (see Figure 3-14).

FIGURE 3-14

FIGURE 3-14

Dragging the blocks from the Disabled area to the Right Sidebar region enables the block and sets its order. You can reorder blocks by simply dragging them up or down on the screen. The order in which they appear on the Block admin page is the order in which they will appear to the user.

GETTING IN CONTACT

Allowing site visitors to contact you is an essential piece of any website. Drupal's Contact module (which is disabled by default) provides a quick and simple mechanism for site users to contact one or a group of e-mail addresses. Users may also select from a list to direct their inquiry to the right person. For example, inquires to "Report a bad link" could be directed to the site's webmaster, whereas inquires to "Contact us about advertising" can be directed to the sales department.

In the following exercises, you enable and configure the Contact module.

_ Enabling the Contact Module

In this first exercise, you enable the Contact module.

1. Log into your website as an Administrator. Click Modules in the Administration menu at the top of the screen, as shown in Figure 3-15.

A Dashboard Content Structure Appearance People Modules Configuration Reports Help Hello jredding Logout Add content Find content Edit shoi

Home a Administer

Modules o

TRY IT OUT

Download additional contributed modules to extend Drupal's functionality.

Regularly review and Install available updates to maintain a secure and current site. Always run the update script each time a module is updated. + Update existing modules + Install new module

Download additional contributed modules to extend Drupal's functionality.

Regularly review and Install available updates to maintain a secure and current site. Always run the update script each time a module is updated. + Update existing modules + Install new module

ENABLED

NAME

VERSION DESCRIPTION

OPERATIONS

Aggregator

Aggregates syndicated content (RSS, RDF,

7.x-dev and Atom reeds).

FIGURE 3-15

2. Under the Core module category, enable the Contact module by checking the box to the left of the name.

3. Click the Save Configuration button at the bottom of the page. How It Works

Before the Contact module can be used, it must be enabled. Enabling a module in Drupal is as simple as checking the box next to it and saving the page.

TRY IT OUT

Article Marketing Knockdown

Article Marketing Knockdown

The lifeblood of any online business is in being able to generate highly targeted, consistent traffic to your websites, landing pages and squeeze pages.

Get My Free Ebook


Post a comment