Preface

A high quality web site can be an important part of any business marketing plan. However, many businesses choose not to have a web site because they think it will be too expensive or too difficult to build and maintain. You can purchase hosting for a web site for as little as US 5 to US 10 per month. You can create your own site using a design program for a few hundred dollars, or you can have a professional web site designer create the site, which can cost several thousands of dollars. After...

Creating events using CCK

Good Eatin' Goal Build events using the CCK module and the Date module, rather than the Event module, thereby giving additional control over the events. Additional modules needed CCK http drupal.org project cck , Date http drupal.org project date . Depending on your site, it may be more convenient to use CCK and the Date API to build dates. This strategy also gives you additional control over what information is included in the event and in the display. In addition, all required modules should...

Advanced customization with content templates

Good Eatin' Goal Discuss the possibilities that are offered by Content Templates. Additional modules needed Content Templates http drupal.org project contemplate . The content template module, also called ConTemplate, is available for download at http drupal.org project contemplate. This module provides an easy method of customizing the display of your content. The content template module has a few settings that are related to performance-tuning when templates are created. If you experience any...

Allowing files to be uploaded to the web site

Good Eatin' Goal Allow authorized users to upload a file to the web site. Additional modules needed Upload core . In order to allow a user to download a file, you must first upload files to the web site. We will create a downloads page that stores all of the files that have been uploaded. 1. Begin by activating the Upload module, which is a part of the core Drupal distribution. 2. We can now customize the permissions for the Upload module by clicking on User management and then on Permission....

Allowing users to signup for the newsletter

Good Eatin' Goal Demonstrate how registered and unregistered users can sign-up for a newsletter, and configure the registration process. Additional modules needed Simplenews 1. To allow customers to sign-up for the newsletter, we will begin by adding a block to the page. 2. Open the Block Manager by selecting Site building and then Blocks, from the Administer menu. Add the block for the newsletter that you want to allow customers to subscribe to, as shown in the following screenshot 3. We will...

Introducing Good Eatin

Although several books have been written about Drupal, most have been written for developers to help them understand how to build sites with Drupal, enhance sites by using custom modules, and change the appearance of Drupal based sites by using themes. In this book, we take a different approach. Throughout the book, we will develop a web site for a fictional business, to meet the needs of this business. We have included an explanation of all of the key features in Drupal that most...

Modifying the order of fields and the titles of the menu item

Good Eatin' Goal Customize how the fields of our menu item content type are displayed, to maximize usability for our visitors. The most basic customization you can do is provided by the CCK module. This module allows you to control how each field is labeled, and the format used to display it. To use the basic display customization, edit your content type and then click on the Display fields link at the top of the screen. Drupal will then display a screen similar to the one shown below Home...

Basic steps for inserting a slideshow

Setting up a slideshow with individual images The title will be displayed above both the picture and the description. It can be left blank if you do not want to display a title. The description is displayed immediately below the title but above the picture. This can also be omitted if it is not required. The target is used in conjunction with the link and describes how the new page will be opened when the image is clicked. Valid values are _blank, _parent, _top, and _self. The _blank option,...

Adding an argument to control meal display

In order to display menus for each meal independently, we will add an argument to the view. This will allow us to specify a specific meal that is to be displayed on each page. 1. Click on the symbol next to the Arguments link, and Drupal will display a list of all of the available arguments, as shown in the screenshot Comment Author The name of the poster. The website address ofthe comment's author. Can be a link. The homepage can also be linked with the Name field. Will be empty if posted by a...

Table of Contents

Chapter 1 Introducing Good Eatin'_7 Plans for a Good Eatin' web site 8 Selecting a foundation for the Good Eatin' site 9 Fully-customized site with PHP and MySQL 11 Drupal content management system 12 Benefits of building with Drupal 13 Extending the Good Eatin' site to other businesses 14 Jumping straight to dessert Good Eatin' on the web 21 Chapter 2 Creating Good Eatin's Online Presence_23 About Good Eatin' Adding static pages 24 Spicin up your site with simple HTML 25 Street presence,...

Timing the publication of content

If you have time-sensitive information, you can schedule the content for automatic publishing on a specific date and or at a specific time. You can do this by using the Rules module for Drupal 6, which is available at http drupal.org project rules or the Workflow-ng module, for Drupal 5, which is available at o About Good Eatin' Good Eatin1 Bistro is an upscale restaurant serving breakfast, iunch, and dinner seven days a week. Our executive Administer chef has won numerous awards from local...

Adding new events to the calendar

Good Eatin' Goal Create an event that will be displayed on the calendar. Additional modules needed Event http drupal.org project event . 1. In order to add an event, you must first install and activate the Event module in the Module manager as shown in the following screenshot Activating the Event module will a create a new Event content type. There are also several settings that control how events are displayed and how time zones are handled. 2. To modify the time zone settings, select Site...

Importing subscriptions from an existing list

Good Eatirt Goal Import subscriptions from another list management system that was in use prior to you starting to manage your newsletter by using Simplenews. Additional modules needed Simplenews If you already have a large list of subscribers to your newsletter, you probably wouldn't want to throw this list away because a good contact list takes time to build and can be very lucrative for you. You can import a comma-delimited list of email addresses by clicking on the Mass subscribe link from...

Selecting and installing a readymade theme

You can find a large list of themes that have been contributed to Drupal at http drupal.org project Themes. You can use these themes as inspiration for your own site design, or you can use a theme as-is. Most themes are shown with a preview image so that you can get an idea of what your site will look like using the theme. After you have found a theme that you want to try, you can install it on your site by carrying out the following steps 1. Download the theme by clicking on the Download link...

Online Orders and Payments

A common goal for many business web sites is to integrate their web site with their store, take reservations, and accept payments. For example, a retail store may allow customers to browse their store inventory and then purchase items either for delivery or for pick-up at the store. A salon may allow patrons to view appointment times that are available, select a time for their appointment, and optionally pre-pay for their appointment online. For the Good Eatin' site, we will allow customers to...

Working with comments

In this group of tasks, we will explore Drupal's built-in functionality to allow users to comment on your content. We will cover setting permissions for to determine who can comment and also describe the approval process for comments, to help prevent unwanted messages from being posted your site. Good Eatin' Goal Allow registered users to leave comments on a new guest book page. All comments must be approved before they are published, unless the customer is a VIP customer, in which case their...

Social bookmarking with service links

Good Eatin' Goal Allow customers to easily add our content to several different social bookmarking sites. Additional modules needed Service Links http drupal.org project service_links . If you would like to display links to several social bookmarking links at the same time, you can do so with the Service Links module. This can be useful if you need many links and don't need specific controls over each individual site. 1. Begin by installing and activating the Service Links module. 2. The...

Displaying a calendar using views and CCK

Good Eatin' Goal Display a calendar that gives more details than a block view on a page. Additional modules needed Calendar http drupal.org project calendar , Views http drupal.org project views , Date API http drupal.org project date . Now that we can create events using CCK, we need to display them on the site. We will begin by creating a page where visitors can browse all of the upcoming events using a convenient calendar. 1. Begin by installing and activating the Views and Calendar modules...

[packt

Interacting With Customers and Visitors 1. First, select the Content Type that you want to add ratings to, by opening the Content Type Manager and then editing the Content Type. 2. Expand the Fivestar ratings section, as shown here 3. For Chef Wanyama's site, we have selected the Enable Fivestar rating option, and customized the display of the rating. We have also enabled ratings when the user comments on our menu item. 4. Save the Content Type and your changes will be automatically applied. 5....

Using taxonomy to categorize content

Taxonomy is a powerful way of classifying the content on your site. After the content has been classified, you can group or filter the content based on the categories that have been set for the content type. If you only have a few pages of content, or if you are grouping based on only one category, the taxonomy module is probably overkill for your needs. But the power of taxonomy is readily apparent if you have hundreds of pages of content and complex categorization needs, or when you are...

Embedding a You Tube video with a filter

Good Eatin' Goal Add videos that are stored on YouTube to an existing page. Additional modules needed Video Filter http drupal .org project video_filter . YouTube www.youtube.com is a popular video sharing site where you can view videos that have been created and submitted by people across the globe. YouTube allows you to link to videos stored on their site so that you can share them with your own visitors, without incurring bandwidth charges. In fact, you can even earn revenue from the videos...

Viewing the slideshow

There are several ways of adding the slideshow to your page. If you are using simple img tags, you must surround the image with a link that tells the Lightbox to open. For example, the following code will display a thumbnail image on the page. lt a href image view 3 preview rel lightbox When the user clicks on the image, the preview image will be displayed in the Lightbox. Any other images on the page that contain the rel lightbox attribute will also be displayed in the Lightbox. The latest...

Additional configuration options

Slideshow Creator also contains several undocumented features that you can use to further customize your slideshows. Some of these allow you to override the default settings that are configured via the Administration menu, so that you have more precise control over the layout of the slideshows, and you can have slideshows with different sizes and layouts on different pages. You can even have multiple slideshows on one page, each with different options. The following options are available width...

Adding a price to the menu item

Good Eatin' Goal To add a field which will store the price of the menu item. Additional modules needed CCK http drupal.org project cck . Now that we have created the Menu Item content type, we can set up the custom fields for our type based on the design we did earlier. 1. To create a new field, edit the Menu Item by clicking on the Edit link in the Content Type Manager. 2. Next, click on the Add field link. Drupal will then display a form where you can define the basics of the new field. Edit...

Adding an image for the menu item

Good Eatin' Goal Allow Chef Wanyama to optionally add picture of the item for display in the menu. Additional modules needed CCK http drupal.org project cck , IMCE http drupal.org project imce , IMCE CCK Image http drupal.org 1. Begin by downloading and installing the IMCE and IMCE CCK Image modules. 2. Create a new field, by clicking on the Add field link. Name the field Picture and set the label to Picture. The type will be an IMCE image with an IMCE image widget. 3. After you click continue...

PacktI

This strategy has a couple of advantages. Firstly, you are freed from the maintenance of pre-approving all content before it is published. Secondly, it ensures that the content meets community standards, rather than placing you or your editors in charge of defining community standards. The Abuse module also has a Watchlist component that allows you to flag content as suspicious or banned, and automatically move them into a queue for review by an administrator. 1. Begin by downloading and...

Keeping a Clean Kitchen

Now that we have built our site and integrated it into our business, we need to ensure that our site stays clean and up-to-date. In this chapter, we will explore various maintenance tasks to keep our site operating at peak performance. We will begin by discussing how to back up our web site and then restore it again, to protect it against hardware failures or malicious users. Next, we will discuss performance tuning to ensure that your site can meet any level of traffic demand. Finally, we will...

Showing images on the page using Slideshow Creator

The Slideshow Creator module can be downloaded from http drupal.org project slideshow_creator. It also requires the JQuery Plugin module, which is available at Download these two modules, install them on your site, and then enable them using the Module Manager. The Slideshow Creator module does not have any additional permissions that you need to worry about. However, there are a few configuration settings The text to be displayed on the Current Slide part These options allow you to control the...

Inserting images with simple HTML

HTML provides the img tag to allow web sites to include images on their pages. You can use the img tag as follows lt img imagename' gt . For example, a link to an image on the Good Eatin' site could be You can either use double quotes or single quotes around the source, but I found that using single quotes typically integrates better with Drupal. You can also add size information to the image if you want, by adding width and height attributes to the tag. A tooltip can be added to the image by...

Showing images over the page with Lightbox

The Slideshow Creator module allows you to view slideshows within a page. However, sometimes it looks better to display images in a new window that floats over the main page. This is especially true for pictures on a photography or art web site, where the pictures are the main focus of the page. Showing the slideshow over the main page also improves the appearance of the slideshow when all of the pictures are not the same size. Creating Good Eatin's Online Presence_ A sample lightbox looks like...

Getting a Google maps API key

Good Eatin' Goal Obtain a Google Maps API key, which will allow us to embed maps into our web site. Google requires you to obtain a key from them if you want to use one or more of their maps on your web site. This is a very simple process. 1. The full process is described on Google's web site at 2. If you do not already have a Google account, you will need to sign-up for a new account. 3. After you have signed up for an account, you will need to read and accept the terms of service, enter the...

Displaying content in popups

Good Eatin Goal Enhance our map location by displaying a pop-up balloon when a visitor clicks on our pin. Additional modules needed GmapEZ http drupal.org project gmapez . If you have played with your map, you may have noticed that there is no information available when you click on the pin. Google allows you to display information in the pins. To do this, we will use the following steps 1. Adding pop-up info windows to a location is very easy. You simply need to add a div tag containing the...

Automatic image handling settings

The Automatic image handling settings are used to control how Lightbox2 automatically inserts itself into the images within your site. If used correctly, this functionality will save you a great deal of time because you don't need to manually add links to each image and ensure that you have all the settings correct. In most cases, you can leave these settings with their default values as they are all set to sensible values. However, there are a few settings that you should take note of Image...

Insert a simple map with GMapEZ

Good Eatin' Goal Add a basic map in a new page to the web site. We will control where it is centered as well as the zoom level. Additional modules needed GmapEZ http drupal.org project gmapez . 1. Begin by installing and activating the GmapEZ module. 2. We now need to enter our API Key by clicking on Site configuration and then on GmapEZ. The configuration options are shown in the following screenshot Yo u r Googl e M ap key. If inwalid, you can create a rtew one. 0 Always add GMapezto a page...

Creating a Company Blog

A blog is a series of typically short postings that are displayed in reverse chronological order. Blogs normally allow users to comment on each posting. With a regularly updated blog or blogs, you can ensure that your site always has fresh content, which ensures that both visitors and the search engines keep coming back. In this chapter, we will create a blog where Chef Wanyama can discuss the Good Eatin' restaurant, cooking, the restaurant business, and more. He plans to use the blog to make...

Embedding media from Flickr

Good Eatirt Goal Add a preview image for our Cooking Class content type using Flickr. Additional modules needed Embedded Media Field Buzzword Compliance Whisking in Some Web 2.0_ We have previously used the Embedded Media Field module to display YouTube movies on our site. In this step, we will also use it to display images from Flickr. 1. If you have not already installed and activated the Embedded Media Field module, do so now. We also need to activate the Embedded Image Field module, which...

Using the Flickr module to insert photos using a filter

Good Eatin' Goal Add images to an existing block of text using a filter. Additional modules needed Flickr module http drupal.org project flickr . Although the Embedded Media Field is very convenient for adding pictures as a field, there may be times when you want to display an image within a block of text. To do this, we will use the Flickr module. 1. Begin by installing and activating the Flickr module. There are several available modules included, but we only need the Flickr and the Flickr...

Enhancing content with the Embedded Media Field

Buzzword Compliance Whisking in Some Web 2.0_ In the last two topics, we explored inserting YouTube videos into existing content. But what if you want to add video fields to all instances of a specific content type For example, if you have a content type for a cooking class, you could include fields for Video giving a preview of the class In this case, it would be much better to have a specific field for the video rather than embedding it into text with a filter. Let's build the example above...

Creating a You Tube playlist and display a random video

Good Eatin Goal Enhance the YouTube filter to play from a list of videos, and explore other features of the Video Filter module. Chinese dumplings are a popular appetizer on the Good Eatin1 menu. We make ours with a variety ot rare meats including ostrich, emu, and crocodile rather than more traditional chicken and pork. Additional modules needed Video Filter http drupal.org project video_filter . Now that you can add a single video to your page, you may want to add more videos that are...

Working with polls

Drupal Poll Module

Polls are a great way to quickly get information from your users. Visitors like to answer short polls, especially if the results are immediately available and the questions are interesting. In Drupal, polls can contain only a single question, along with a set of predefined responses that the user can choose from. Good Eatin' Goal Create a poll to allow Chef Wanyama to get feedback from customers. The first poll will ask customers what their favorite meal is at Good Eatin'. Additional modules...

Working with users

In this series of tasks, we will explore Drupal's user functionality, which allows you to add users to your site and specify the functionality that they can use. We will also discuss the concept of roles, which allow you to create a group of permissions that can easily be assigned to users. Finally, we will discuss how to assign roles to the users. Good Eatirt Goal Allow users to register on the web site so that they can access additional content that is not available to unregistered visitors....

Adding user surveys

User surveys allow more complex methods of querying visitors for information. Surveys support multiple questions that are asked at one time and questions that require more complex answers than a simple selection between a finite number of predefined choices. Chef Wanyama will use the user survey to get more comprehensive information about his customers' dining experience and what they expect from the restaurant in the future. Good Eatin' Goal Add a survey to the Good Eatin' web site that asks...