39,59 €
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.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 332
Veröffentlichungsjahr: 2012
Copyright © 2012 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2008
Second edition: January 2012
Production Reference: 1090112
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84951-664-8
www.packtpub.com
Cover Image by Karl Moore ( <[email protected]> )
Authors
Trevor James
Mark Noble
Reviewers
Richard Carter
Adam Hill
Jeffrey Smith
Ravishankar Somasundaram
Senior Acquisition Editor
Usha Iyer
Lead Technical Editor
Dayan Hyames
Technical Editors
Apoorva Bolar
Priyanka Shah
Project Coordinator
Vishal Bodwani
Proofreader
Mario Cecere
Indexer
Hemangini Bari
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
Trevor James is a Drupal developer based in Middletown, MD, USA. Trevor has been designing websites for 15 years using a combination of PHP, HTML, XHTML, CSS, and ColdFusion, and has been using Drupal intensively for over five years. Trevor's focus is on building web applications and portals for education, non-profit, medical systems, and small business environments.
He is interested in best methods of integrating Web services with Drupal sites, optimizing Drupal site performance, and building custom Drupal content displays using Views, Panels, Display Suite and other contributed modules. Trevor develops front end Drupal-based interfaces that support data intensive websites. He loves teaching people about Drupal and how to use this excellent open source content management framework.
Trevor authored the Packt book, Drupal Web Services, published in November 2010. For more on this title visit: http://www.packtpub.com/drupal-web-services/book.
Trevor co-authored the Packt title, Drupal 6 Performance Tips, published in February2010. For more on this title visit: https://www.packtpub.com/drupal-6-performance-tips-to-maximize-and-optimize-your-framework/book.
Trevor created a 14 hour video tutorial series on Drupal 7 for VTC (Virtual Training Company) in 2011. The video is available via the VTC website here: http://www.vtc.com/products/Drupal-7-Tutorials.htm.
Thanks to the Packt editorial staff including Usha Iyer, Vishal Bodwani, Gaurav Mehta, and Dayan Hyames for approaching me originally about writing the second edition of this title. It's been great working on the updated version of the book for Drupal 7. As always the Packt editorial staff have impressed me with their professionalism and knowledge of Drupal and open source. They continue to contribute back to the open source community and to the Drupal community with their titles and as always contribute a percentage of the profits from this book back to the Drupal Association.
I thank all the reviewers of the book who worked closely with me to get this finished product out the door.
The authoring process takes a great deal of time and I thank my family for allowing me to devote countless hours to the writing process. Much thanks to my wife Veronica and our lovely twin daughters Francesca and Clare.
This book is for all the new Drupal users out there. I hope you are as inspired by Drupal as I am and this software helps you to build a rich and dynamic site for your small business. Drupal on!
Mark Noble has worked in software development and website design for over 13 years, in a variety of capacities including development, quality assurance, and management. He takes pride in developing software and websites to make businesses run more effectively, and delights in helping users to get their jobs done more easily.
Mark currently works developing websites, using a combination of Java and PHP, to help libraries to manage their collections. He also performs contract work for clients in a variety of industries, developing both traditional desktop applications as well as web-based applications, using Drupal and a variety of other technologies. When he isn't working for a client, Mark enjoys building sites using Drupal. His other hobbies include playing with his family, photography, hiking, travel, and geocaching.
I would like to thank my wife, April, and my kids, Zoe and Theo, for their support during the writing of this book. I know that at times when deadlines got short, I did too. I love you all and I'm looking forward to having some downtime and relaxation with everyone.
Richard Carter is the Creative Director at Peacock Carter Ltd (http://www.peacockcarter.co.uk), a web design and development agency based in the North East of England, working with clients including Directgov, NHS Choices, and BusinessLink.
Richard is the author of MediaWiki Skins Design, Magento 1.3 Themes Design, Joomla! 1.5 Templates Cookbook,and Magento 1.4 Themes Design. He has acted as a technical reviewer on MediaWiki 1.1 Beginner's Guide, Inkscape 0.48 Essentials ForWeb Designers, and the Definitive Guide to Drupal 7, and is a co-founder of the Drupal North East user group (http://www.drupalnortheast.org.uk).
He blogs at http://www.earlgreyandbattenburg.co.uk and tweets nonsense at http://twitter.com/RichardCarter.
I would like to thank the author of the book for dedicating time to helping others learn Drupal, which has changed beyond most recognition in the last few years.
Jeffrey Smith has 15+ years experience in the IT industry and about eight months experience as a .NET developer. He loves trying new things which is a blessing and a curse.
He loves technology and trying new things. He is currently ramping up his JavaScript and Ruby on Rails skills. He is a .NET developer by day and experiments with new things at night. He is working on projects that use ASP.NET MVC, C#, Coffeescript, Drupal, JQuery, MongoDB, PHP, Ruby on Rails, Rhomobile, Sproutcore, and the Strobe framework.
Ravishankar Somasundaram has over six years of experience in providing solutions to clients across multiple sectors and domains. Being more passionate about learning and teaching, he also strongly believes that the sole purpose of learning is to make our minds think in different perspectives and facilitates the same in his training sessions through a blended learning approach mainly focused on how to "learn to learn".
In his early schooling apart from winning several prizes in science projects, he was awarded the Title "Junior Scientist" by a committee consisting of people from ISRO in an Inter school Science Fest for a model display on "Evolution of Airplanes through Aerodynamics", this is one of his childhood achievements.
His final year college project aimed at eliminating the scenario of English alone being the medium of programming in all programming languages, which restricts people who don't know English getting into the IT field and implementing their ideas, was selected and funded by MIT NRCFOSS and considered a landmark.
Being one of the seven people from India and the only one from Tamil Nadu as an official third party developer of Moodle code, he shares his knowledge by helping people on Moodles official forum and on IRC. He has also presented a paper in the ninth International Tamil Internet conference on "Moodle: For Enhanced Learning" which talks about leveraging Moodle's capability to expand the user base for one of the oldest languages known to mankind—Tamil.
Ravi was a Freelance IT Consultant delivering solutions to firms irrespective of Technical, Non-Technical or Business domains. Currently he works for Thirdware Technologies as a Technical Analyst and Chief Architect heading the R&D Division.
Recently he represented his company at an International conference "Yugma—Unleashing the Innovation potential" with an idea which uses Artificial Intelligence to empower the next generation enterprise mobile solutions.
I am thankful to all the people I have met till date, for they have contributed to the cause of my growth either by being an inspiration or personally guiding and pointing me to the right direction when facing challenging situations or throwing critiques continuously, making me recognize there is always an area for improvement in my career and personal life
Last, but the foremost, I dedicate all my accomplishments to my parents, sister and other relations for all their faith, hope, love, and support.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
You can use the Drupal 7 content management framework to build a small business website rapidly. You may add blogs; images and image galleries; maps, e-commerce and shopping carts; social application integration including Twitter and Flickr, 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 using the new Drupal Commerce module so you can sell your products online. You'll add YouTube videos, Google maps, and Flickr-based photos 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 over time so you can market your business successfully with a professional, flexible and optimized website.
Chapter 1, Planning our Site and Setting up Drupal: In this chapter we plan for and map out our website and its content with the Drupal content management system as the backbone. We look at the advantages and benefits of using Drupal to build our site. We install Drupal and set up the website's initial basic configuration.
Chapter 2, Creating the Artisan Bakers Collective Website:In this chapter we continue configuring Drupal and learning how to run a cron task and check the Drupal status report. We enable clean URLs, and add some Basic Page and Article content to our site. We add users to our site and configure basic user permissions. We discuss the various types of home pages we can configure using Drupal. We configure path aliases, set up navigation menus, tweak the order of our menu items, enable core modules; and install contributed Drupal modules.
Chapter 3, Adding Products and Services:In this chapter we build a custom content type using Drupal. We configure the content type and add custom fields to the content type in order to post specific data to our site using the content type's form. We install and configure the Date module to handle adding fields to our content type to collect date and time information. We set up some basic access control to our content type. We also build some taxonomy vocabularies and add tags to our site.
Chapter 4, Interacting with Customers and Visitors: In this chapter we add user roles to the site and extend the user signup form to add fields to collect user profile data. We enable and configure the Comments module and create some specific comments-based actions and triggers.
Chapter 5, Creating a Company Blog:In this chapter we enable and configure the Blog module. We add some blog posts and set up a moderation system for our blogging. We learn how to configure advanced actions in Drupal. We add easy access methods for our site visitors to be able to get to and read our blog posts by enabling blocks that show recent blog posts. We add RSS feeds to our site's blog. We learn how to aggregate content from other websites using the powerful Drupal Aggregation and Feeds modules.
Chapter 6, Newsletters and Calendars:In this chapter we set up e-newsletters on our site using the Simplenews module. We learn how to add a Newsletter and send it via e-mail to our site visitors. We set up a subscription service for the newsletters. We add an Event content type to the site and create a visual calendar of our events using the Calendar module.
Chapter 7, Sharing and Consuming with YouTube, Flickr, Google Maps, and Twitter:In this chapter we learn how to embed YouTube videos on our site. We install and configure the Flickr module to add Flickr photosets and photos to our site via a web service API. We add Google Maps to our site and also learn how to tweet our site content automatically to our Twitter account.
Chapter 8, Freebies and Downloads:In this chapter we learn how to post files including PDFs to our site's content so our site visitors can easily download these files. We configure both public and private file systems on our site. We install and configure the Print module which adds printer-friendly versions of our site's pages, e-mail to friend functionality, and PDF versions of our site's content. We install the dompdf library so we can generate PDFs of our site's content automatically.
Chapter 9, Online Orders and Payments: In this chapter we install and configure the new Drupal 7.x Commerce module to add e-commerce functionality and a shopping cart to our site.
Chapter 10, Image Galleries and Slideshows:In this chapter we use the Views and Views Slideshow modules to set up image galleries and dynamic slideshows of our image collections.
Chapter 11, Maintaining and Optimizing your Drupal Site:In this final chapter we discuss best practices for maintaining and optimizing our Drupal website and its MySQL database. This includes discussions of Drupal performance and some tips for getting the best performance and optimization out of your website.
This book is for anyone who wants to learn how to set up a website quickly for their business using the super powerful Drupal open source content management software.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: " Let's tweak the label to read Description of Item."
A block of code is set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "You'll see a message stating that Cron ran successfully:".
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Although several books have been written about Drupal 7, most have been written for developers to help them program sites using Drupal coding standards, enhance sites by using custom modules, and change the appearance of Drupal sites by using themes. In this book, we take a different approach. Throughout the book, we will develop a website for a (fictional) business and meet the needs of this business.
We have included an explanation of all the key features in Drupal that most small-to-medium-sized businesses would want to use on their sites. A thorough step-by-step description of how to integrate each piece of functionality into your website is included, along with an explanation of the business need that is being satisfied by using the functionality.
After reading this book, you will be able to adapt the techniques used in this book to either develop a site for your company on your own, or work with a development firm to create a website that truly meets the needs of your business.
In this chapter, we will introduce our client, the Artisan Bakers Collective and discuss their plans to build a website. We will also introduce Drupal 7 and describe why it is a good fit for our client's website.
In this chapter, we will cover the following topics:
Baker James is the owner of the Artisan Bakers Collective, a popular artisan bakery, café, and store. The past few years have been very good, and he has expanded from one bakery to three. Each bakery is decorated in a retro theme and Baker James is extremely proud of the decor. The Artisan Bakers Collective offers a wide variety of breads and baked goods, but specializes in creating sourdough bread using traditional European-style slow-rise recipes handed down over generations.
Baker James wants to add an e-commerce component to his business, so that he can reach a larger clientele, which he feels will bring in additional revenue. He also gives baking classes and would like to promote this.
Baker James had a website designed for him several years ago, but it has proven to be difficult to maintain and is therefore several years outdated. James would like to build a new website for his businesses that is easy to update and maintain. He would like to provide a destination for his customers where they can visit his bakery online, learn more about the bakery, find out about classes, events, and the featured breads, and receive discounts, if they are loyal customers.
Baker James has several key goals for his site, which are as follows:
After Baker James came to us expressing his desire to have a new website built, we sat down with him to determine what pages and sections should be added to the website, so that we can plan our development. Based on these discussions, we decided on the following features for the site:
In this section, we will explore a range of possible technologies that could be used to build the Artisan Bakers Collective website. The pros and cons of each method will be discussed, and we will choose the final technology that will be used to build the website.
Many websites continue to be built by simply creating standalone HTML pages that do not change frequently over time. These pages can be created with a dedicated website design program or with a simple text editor. These pages are then uploaded to the web server, using an FTP client or another transfer client provided by the web host.
There are several advantages of using this method of web development, listed as follows:
Although static web pages can be easy to develop, there are a number of disadvantages that appear after you deploy the website and try to make revisions to it later. The disadvantages are listed as follows:
You could also build a fully-customized website, built entirely from scratch, using a programming language such as PHP and a database such as MySQL. In this type of system, one or more programmers build custom code specifically for your website. Some common libraries may be used to speed up development, but the majority of the site will be custom-created.
There are several advantages to developing a completely custom-built website for your company, which are listed as follows:
Unfortunately, developing a completely custom website is a difficult, time-consuming process and has several disadvantages. They are listed as follows:
Drupal is an open source content management framework based on PHP and MySQL. To use Drupal, you need to install it onto your web server. After it's installed, you use Drupal to create and edit pages. Drupal handles most of the common functionalities that are needed to build websites of any size, and also handles many complex functionalities with the help of plugin Drupal modules, including:
Although these features alone are sufficient to handle many sites, Drupal also offers a powerful module system that allows developers to create modules that plug in to the core Drupal framework to seamlessly provide new capabilities. Many modules have been created by the Drupal open source community and released for use under open source licenses, free of charge. Modules are available for nearly every conceivable task, but if you don't find what you are looking for, a custom module can always be created to handle your exact needs.
Drupal also provides a powerful theme system that allows you to change the look and feel of your website and have all of the pages changed throughout the entire website, instantly. Hundreds of free themes are available on the Drupal website, and these can be customized to fit your needs. Alternatively, you could develop a custom theme for your own website. Commercial themes can also be purchased.
Drupal offers a number of benefits not found with the other methods of building a website. Many of these are related to the ease of maintenance and the ability to concentrate on business functionality rather than building common, repetitive functionality. The benefits of Drupal are listed as follows:
