Summary

This chapter focused on creating content, setting the various options that are available when creating a content item, updating and deleting content. You learned how to place a content item on a menu so users can easily find and view content, and how to create search-engine- and user-friendly URLs. At this point, you have the basic skills and understanding necessary to create a basic Drupal website, but stopping now means that you would miss out on all of the other rich and powerful features...

Modifying the Base Theme

Before starting the modification process, it's important to understand the basic structure of the starter theme. The first thing that I look at when modifying a theme is the list of regions defined by the starter theme. In the case of Genesis, I open and look at the genesis_mytheme.info file, which can be found in the sites all themes genesis_mytheme directory. The starter theme defines the following 12 regions Secondary content Highlighted content Content First sidebar Second sidebar Tertiary...

URL Path Settings

You may have noticed while working with the revisions feature that the URL that was shown in your browser's address bar looked something like http localhost node 1, where node in the URL tells us that Drupal is displaying a single piece of content (a node) and 1 represents the unique ID of the node that is being displayed. In this case, it's the first node that we created in the system, so the ID is 1. That number will increase by 1 for each node we add. Although http localhost node 1 gets us...

Nodequeues

One of the challenges of building a website is to make it easy for content authors to create content and to have that content show up in the right position on the right page. You could give them access to the admin screens for Panels, where they could manually assign each node to a specific position on a page, or you can implement Nodequeues, which provides a simple mechanism for content authors to pick a queue where they want their content to appear. You the developer create individual...

Creating a New Menu

There may be situations where you need to create additional menus beyond what ships with Drupal 7. As an example, when creating Drupal-based websites for public libraries, I am often asked to build unique menus for each department in the library (a menu for adult services, youth services, teen services, circulation, and so on). In such a case, the basic menus shipped with Drupal 7 are not enough to fulfill the library's requirements. To create a new menu, click on the Structure menu item at the...

Deploying to Production

It's now time to deploy your site to your production-hosting environment. A. If you created your site on your desktop or laptop you'll need to copy the entire Drupal directory to your production web server, and you'll need to backup your database and restore the database on your hosting environment. For additional details on this process please see Chapter 13. B. If you created your site on a hosting providers platform you are already there and don't need to move your site.

User Accounts

All Drupal websites have at least one user account the system administrator. This account is created automatically during the installation process, and is the account that you will use to administer your site. For sites where the site owner is the only one who creates content and administers the site, having just the site administrators account is all that is required. If you anticipate having others who will administer or create content, then you'll need to decide which Drupal mechanism will...

Pathauto

One of the key elements of successful search engine optimization is providing URLs on your site that are meaningful. By default, Drupal 7 out-of-the-box URLs look something like http localhost node 1. To a search engine, they have no idea what node 1 means, nor what the content associated with that page may be about just by looking at the URL. Humans visiting the site may also have a difficult time navigating around to pages that are not linked or accessible by a menu, as http localhost node...

Social Networking

We are in the middle of a fundamental shift in how websites interact with visitors. We've moved from designing and developing websites that allow visitors to look at content to sites that allow visitors to participate in the process of creating content and sharing that content with the their circle of friends. While the general term used for this is social networking, I like to think of it as the concept of the participative web. In this appendix, I'll show you how to leverage Drupal's core...

Setting Up the Server

Before you install Drupal, you need three basic components in place the server, the web server, and the database. If you are hosting your site with a commercial hosting company, you can skip to the installing Drupal section, as everything you need is already installed. Depending on the operating system on your computer, you may already have a few of the required components already installed (for example, OSX comes with Apache and PHP already installed). However, getting all of the components to...

Download and Install Contributed Modules

To fulfill the functional requirements for the new site, I'll need to download the following contributed modules Views To create lists of resources and events Pathauto To create SEO and user friendly URLs Backup and migrate To automatically backup the site Webform To create online forms Date To enable entering information as date formatted fields I'll follow the instructions outlined in Chapter 8 and install and configure the modules before moving onto the next step. With the contributed...

Adding a Content Item to a Menu

There are two approaches for adding items to menus you can use the menu administration form (see figure 5-4) to create a new menu item, or you can create a menu link from the content item that you wish to reference from within the form used to create or edit that content item. The best practice is to use the content creation form (see figure 5-3) or, as we will see later in the book, other element creation forms such as a panel page or a view. The reason for using this approach is that when you...

Creating Your First Group

At this point you have OG set up and ready to use. I'll create a group to demonstrate how easy the OG group module is to use. To create a group, click on the Create content link and select the Set up an organic group content type. The key fields associated with the Set up an organic group content type includes Group name. Enter the name you wish to associate with the group. For demonstration purposes I'll create a group called Drupal 7 Fans. Description. Enter a brief description about the...

Selecting a Taxonomy Term when Creating Content

Based on our actions in the previous step, creating a new content item using the Basic page content type will now present the author with a list of values that they can select from to categorize the content they are authoring. To test this feature, click on any of the create content links that we have described previously (such as the create content link in the gray bar near the top of the page). From the list of content types listed, click on the Basic page content type. When the Basic page...

Backing Up Your Site

If you don't do anything else on this list of administrative tasks, at least make sure that your data is safe and recoverable in the case of an unexpected disaster. It's easy to put off backing up your site, as it's likely that you'll rarely need to go back and restore your site from a backup. But speaking from experience, the first time you need to restore your site and you don't have a backup is the last time you won't have backups in place from the start. Take it from the voice of experience...

The Organic Groups Module

Another approach for building social networking sites is to use Drupal's Organic Groups (OG) module. This module provides the ability for users on your site to create their own group, where a group consists of a homepage and the ability for other users to join and create content. You can think of OG as the Drupal version of Yahoo or Google Groups. An excellent example of a site built using OG is www.popsugar.com community groups. Setting up Organic Groups is a relatively simple process that...

Define the navigational structure of your web site

With an understanding of the visitor types, the content that they will want to see on your site, and the logical groupings or major pages that will make up your site, you can now define the navigation menus for your site. If you know that a specific visitor type is a primary visitor of your web site, you should make it easy for that visitor to find the information that they are seeking. The typical mechanism for doing that is to provide some form of menu or menus. In this task you would...

Creating Your First Poll

Poll Drupal

To create a poll, click the Add content link on your site, which reveals the list of content types that you have enabled on your Drupal installation. On that list, you will now see a content type titled poll see Figure 9-13 . Click on the Poll link, revealing the form that you will use to create the poll. As an example, create a new poll that asks site visitors to vote on whether U.S. college football should adopt a playoff structure like the National Football league. Follow the example in...

Web Forms

Collecting information from site visitors through online forms is another key interactive feature that is easy to enable and use on your new site. Using the Webform contributed module, you can create simple forms such as a form that is used to submit a question or complex questionnaires using the features enabled through the Webform module. To demonstrate how easy it is, I will walk you through the process of creating an online suggestion box where site visitors can enter and submit suggestions...

Setting Up Products

With the general storefront parameters set, I'm ready to set up the products on my site. For my site I am going to sell Drupal 7 coffee mugs and t-shirts. The first step in setting up products is to define the product categories that you intend to use on your site. Ubercart uses Drupal's taxonomy system to categorize products, and automatically creates a vocabulary named Catalog. Following the steps outlined in Chapter 4, I'll add the new terms for coffee cups and t-shirts. When creating the...

Ubercart Overview

Ubercart is a full feature web storefront offering key features that make it easy to list and sell physical goods, virtual goods, subscriptions, and event registrations. Ubercart provides a simple-to-use interface for creating product categories, product catalogs, and product listings. Ubercart manages the inventory of the items you are selling, the orders that customers place on your site, the payments customers make, and the shipment process when physical items are shipped from your...

How to Download Install and Configure a Module

The first step in installing a module is finding the right module to use. As described earlier, there are thousands of modules to pick from finding the right one is often the biggest challenge. For demonstration purposes, let's pick one of the most popular, powerful, and useful modules the Views module. A new feature of Drupal 7 is an administrator's page, which allows you to download and install a module by simply entering the URL of the install file and clicking a button. Drupal handles the...

Creating a Panel Page

Drupal Create Panels Teaser

When creating a panel page, you need to decide what content is going to go on the page, as well as the layout for the page. You can use Figure 12-2 to figure out whether an off-the-shelf layout exists that meets your needs. If one of the eight basic layouts doesn't work, you can always create a custom layout using the flexible option. For demonstration purposes, we're going to assume that we want to divide the content region into three rows, with the first row having a single column, the second...

Using the Flexible Layout Option

There may be situations where one of the eight pre-defined layouts available in the Panels module do not meet the layout needs of a particular page. In these situations, you can use the flexible layout option, which provides the ability to create virtually any layout you can imagine. To create a new flexible layout page, follow the steps outlined in the previous section for creating a new panel page click on the Structure link in the top menu, followed by Panels on the Structure link, and the...

Formatting the Output of a Custom Content Type

There will be times when the visual representation of your new content type doesn't fit with how you would like the content created with your new content type to be rendered on the screen. Adjusting the order and positioning of the labels in relation to the field can be accomplished by clicking on the Manage layout link for the desired content type. To access this feature, click on the Structure link at the top of the page and then click on the Content type link on the Structure page. To access...

Assigning a Taxonomy Vocabulary to a Content Type

Providing content authors with the ability to assign one of the terms to a new piece of content requires that a site administrator updates the all of the content types to include a reference to the vocabulary that we wish to link to content on our site. The first step is to identify all the content types that you want to associate with the new vocabulary. You may decide that all content types will use the vocabulary to categories the content created on your site, or you may decide the...

Setting Up Your First Forum

To enable the Forums module, click on the Modules link in the top menu and scroll down the page until you see the Forum module. Check the box associated with the module and click the Save configuration button at the bottom of the page. Drupal will install the Forums module. The next step in the process is to set permissions for forums. Here are the permissions that you can Create new forum topic content Edit own forum topic content Edit any forum topic content Delete own forum topic content...

Configuring Blocks

You can select various configuration setting for blocks on the Blocks Administration page. The configuration options include overriding the title of the block and setting the visibility of the block based on several optional parameters. As an example of how you might use these features in the future, let's change the Who's online block so that it only appears on the homepage of your site, and only when the visitor is a user who has logged into the system with a user ID and password. To make...

Creating a Horizontal Menu

The next requirement for our new theme is to create a horizontal menu that appears below the header. The first step in this process is to add a new region to the theme. To add a new region, edit the genesis_mytheme.info file and add the following line to the end of the list of regions contained within that file regions main_menu_links Main Menu Links This code instructs Drupal to include a new region with an internal name of main_menu_links to the list of available regions. The value to the...

Configuring the Genesis Theme

If you haven't done so already, follow the instructions in Chapter 6 and install the Genesis theme www.drupal.org project genesis . You'll notice that the installation process creates two versions of it Genesis base and Genesis subtheme. A majority of Drupal starter themes use subthemes as the mechanism for creating a new theme based on the foundation provided by the base theme. This allows you to create one or several new themes using the same underlying foundation without having to start from...

Approving Requests for User Accounts

Drupal lets you, the site administrator, determine how user accounts are created on your website. You can Allow site visitors to create their own accounts without approval by a site administrator. Allow site visitors to request an account, but require that a site administrator approve it before allowing the visitor to use the account. Restrict account creation to only the site administrator. The approach you use is completely dependent on whether you allow visitors to have their own accounts....

Electronic Transition Portfolio

Drtgow, EiSiwijfll -SkiiiU optisw-oL Who am, I avu where, etui I JOL U Drtgow, EiSiwijfll -SkiiiU optisw-oL The Electronic Transition Portfolio is a tool that allows High School students prepare for the transitiani to higher education or the workforce. If you do not have an account for the system please check with your teacher. Figure 6-2. A creative non-traditional Drupal theme