Book Image

Drupal 7 Business Solutions

Book Image

Drupal 7 Business Solutions

Overview of this book

You can use the Drupal 7 content management system to build a small business website quickly. You may add blogs, images, maps, e-commerce, social application integration, and more to your site to connect with your customers and make more money from your business. Drupal 7 Business Solutions will give you hands-on practical tutorials on how to build a rich and dynamic website for your business quickly using one of the most popular tools in open source. You'll start by adding blogs and images to your website. Then you'll learn how to add a VIP section to your site so that you can give your logged in users special discounts and other VIP freebies. Next, you will learn to send your customers e-mail newsletters and show them a dynamic events calendar. The book will then teach you to add e-commerce to your site so you can sell your products online. You'll add YouTube videos and Google maps to help enhance your business site. You will then learn to incorporate feedback mechanisms for your customers. The book also explains how to maintain your site, upgrade it, and continue adding dynamic content to it.
Table of Contents (19 chapters)
Drupal 7 Business Solutions
Credits
About the Authors
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

Getting started with Drupal


In this book, we will jump straight into using Drupal to build a practical website, and not spend a lot of time talking about basic functionalities, the design of Drupal, or theoretical aspects related to Drupal. We will use Drupal 7, the most recent active version of Drupal, throughout this book. Drupal 7 is continuously in development, while Drupal 6 is also still supported and available for use on sites. The roadmap for Drupal already shows that Drupal 8 is in the planning stages.

To start using Drupal, we recommend setting up a development environment on your local desktop (either on your PC or on your Mac). You can develop the website for the client on your local computer using a local server, powered by MAMP (MySQL, Apache, and PHP for Mac) or WAMP (the same for Windows). This allows for quick and robust local development. When you're ready to show the client the site, you can easily transfer the Drupal site files and the database over to the client's web host.

You can also install the Drupal Development Desktop Stack that Acquia provides for download. They call this the Dev Desktop (http://www.acquia.com/products-services/dev-desktop), and it packages the entire Drupal core with PHP, MySQL, and an Apache web server.

This section will assume you have chosen either MAMP or WAMP to install on your local computer. We'll be installing Drupal into the web root of your local environment, which is usually htdocs or www.

You're also going to need to set up a database for your Drupal 7 site to use, since Drupal is database-driven. To do this, navigate to your localhostphpMyAdmin application. In MAMP or WAMP, this is easily located through the MAMP or WAMP control panel.

Follow the given instructions for setting up your database:

  1. Open phpMyAdmin and click on the Privileges tab.

  2. Click on Add a new User:

  3. Type in a User name (here I'll enter the username drupal7); set Host to localhost; and type in a password. Re-type the password.

  4. Select the Create database with same name and grant all privileges radio button.

  5. Then click on the Check All link.

  6. Click on the Go button, to create the database:

  7. Jot down the credentials from above, as you'll need them when you install Drupal.

  8. Your blank database is now created and you can now move on to installing Drupal.

You can use the following steps to install Drupal:

  1. Navigate to http://drupal.org, through your web browser. Click on the Get Started with Drupal button.

  2. On the next page, click on the Download Drupal 7.8 button. This will launch a Download & Extend page. You want to download the 7.x version of Drupal, so click on the tar.gz download link to start the download. Save the tar.gz file to your web root directory. At the time of this book's release, the Drupal version is 7.8. It may be a different 7.x version when you go to download it.

  3. After you download the Drupal installation, you will need to unpack it. The installation is delivered in tar.gz format, to unpack which you may need a specialized tool, such as 7-Zip or WinZip. 7-Zip is a freely-available program designed to work with a wide variety of compressed file formats. On the Mac, you should be able to unzip the file by default, without having to download any tools.

  4. Unzip/unpack the tar.gz file in your htdocs or www folder. The resulting unzipped folder will be called drupal-7.8, by default. This is your Drupal site folder.

  5. You can rename the drupal-7.8 folder to be more specific to the site you're building. Let's rename the folder artisanbakers.

  6. You can now browse to the location where you have installed Drupal in a web browser, to begin the installation process. If you are installing on your localhost environment the URL of the install will be something similar to http://localhost/artisanbakers/install.php . You should see a screen similar to the following screenshot, asking you to Select an installation profile.

  7. Leave the installation profile Standard selected, and then click on the Save and Continue button:

  8. Leave English set as the default language and click on Save and continue:

  9. The next screen will ask you to add your MySQL database credentials for the database you originally created for the site. First, make sure to leave the MySQL, MariaDB, or equivalent radio button selected. Now, add your credentials, including Database name, Database username, and Database password, here. Once you add the credentials, click on Save and continue.

  10. There may be a case where you need to add Advanced Options for your database connection. If you are going to be installing and hosting the database on an external server you'll want to expand this Advanced Options fieldset and add the path to the externally-hosted server. In our case, we're hosting the database on the same localhost server, so we do not need to expand this fieldset now:

  11. Drupal will now proceed with the install.

  12. The Configure site screen will load next. This screen is split up into various fieldsets. First, you want to give your site a Site name and Site e-mail address. The site name can be Artisan Bakers Collective. For the site e-mail address, type in your e-mail address, for now:

  13. Now, you need to set up the Site Maintenance Account. This first user account on the site is the super-user administration account. You'll use this account to do all the site development and, later, to maintain the site. For now let's call the super user "admin", so type in admin as the username. You can use the same e-mail address you used previously. Add a password.

  14. The password should be strong and include special characters, such as, # or @. You may also want to use capital letters mixed with lowercase ones and also add numbers to the password. Drupal will check the password, using the password strength visual prompt, and this will assist you in constructing a strong password. This is essential for keeping your site secure.

  15. For Server Settings, choose the Default country and Default time zone for where you are located. This will automatically use the time zone of your country for all date- and time-related functionalities on your website.

  16. Lastly, leave the checkbox next to Update Notifications ticked, to check for updates automatically and receive e-mail notifications.

  17. Click on Save and continue.

  18. The installation will complete and you'll see a congratulations screen. Click on the Visit your new site link, to launch your Drupal 7 website: