ebook img

Drupal 7 : create and operate any type of website quickly and efficiently PDF

401 Pages·2010·9.94 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Drupal 7 : create and operate any type of website quickly and efficiently

Drupal 7 Create and operate any type of website quickly and efficiently David Mercer BIRMINGHAM - MUMBAI Drupal 7 Copyright © 2010 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: April 2008 Second edition: September 2010 Production Reference: 1020910 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849512-86-2 www.packtpub.com Cover Image by Faiz Fattohi ([email protected]) Table of Contents Preface 1 Chapter 1: Introduction to Drupal 7 Drupal—an overview 9 How Drupal came to be 10 What Drupal has to offer 11 Uses of Drupal 13 The Drupal community 14 Documentation 15 Download 16 Support 18 Forum 19 Contribute 21 Contact 22 The Drupal license 22 The Server environment 24 Obtaining and installing XAMPP (PHP, Apache, and MySQL) 26 Troubleshooting XAMPP installation 30 Obtaining and installing Drupal 31 Troubleshooting the Drupal installation 39 Drupal's post-installation status 41 Creating a basic Drupal page 45 Summary 48 Chapter 2: Basic Functionality 49 Modules 50 Working with modules 52 Forum 54 Comments 58 Search 61 Table of Contents Third-party modules 63 Downloading and installing modules 64 Updating modules 67 Working with blocks 69 Adding blocks 69 Configuring blocks 72 Menus, main, and secondary links 75 Summary 84 Chapter 3: Configuration and Reports 85 Before we start 86 Site information 87 Actions and triggers 91 Shortcuts 95 File system 98 Performance 103 Caching 104 Bandwidth optimization 106 Maintenance 106 Logging and errors 108 Clean URLs 109 RSS publishing 111 Reports 113 Summary 116 Chapter 4: Users and Access Control 117 Planning an access policy 118 Roles 120 Permissions 123 Users 127 Administering users 128 User settings 130 Profiles 135 OpenID 141 Summary 146 Chapter 5: Basic Content 147 Content overview 148 Content types 152 Working with content 153 Working with content types 154 Adding content 156 Administering content 161 Table of Contents Content-related modules 165 Aggregator 166 Book 178 Summary 186 Chapter 6: Advanced Content 187 Content and fields 188 Creating new content types 188 Adding fields 190 Displaying fields 194 Taxonomy 196 What and why? 196 Implementing taxonomies in Drupal 198 Introduction to vocabularies 198 Dealing with terms 201 Adding vocabularies to content types 203 Posting content with taxonomy 206 Hierarchies 207 Tagging 210 Formatting 211 Summary 218 Chapter 7: Multimedia 219 Images 220 Fields 220 Styles 224 Files 230 Advanced media handling 235 Embedded media 236 WYSIWYG 239 Summary 246 Chapter 8: Views 247 Introduction to Views 248 Views user interface 248 Displays 252 Configuring categories 254 Live preview 257 Creating a basic view 259 Filters 261 Fields 263 Sort criteria 265 Basic settings 267 Page settings 269 Table of Contents Creating an advanced View 270 Arguments 270 Adding an Argument 272 Setting the Path 274 Testing the arguments with Live preview 275 Relationships 277 Adding a relationship 278 Results 279 Headers and footers 279 Style settings 280 Advanced settings 283 Creating an attachment 283 Theming Views 288 Views CSS 288 Views templates 289 Theme information 290 Creating a custom template file 292 Modifying the custom template file 292 Importing, exporting, and cloning views 293 Summary 295 Chapter 9: Drupal Theming 297 Planning a web-based interface 298 Visual design 298 Language 299 Images 299 CSS 301 Themes 303 Theme anatomy 304 Choosing a base theme 309 Theme settings 312 Customizing themes 314 Sub-themes 315 Working with the Sub-theme 316 Summary 321 Chapter 10: Advanced Features 323 Introduction to Panels 324 A basic Panels page 325 A more advanced Panels page 331 Important Panels features and settings 335 Additional theming 337 Theming nodes 338 Theming pages 345 Table of Contents Customized content reviews 348 Integrating Shadowbox 348 Creating the article reviews view 351 Theming the view 353 Embedding the View 356 Summary 358 Chapter 11: Deployment and Management 359 Deployment 360 The live server 362 Preparing for deployment 363 Deploying the site 365 Configuring the site 368 Access problem? 368 Filesystem settings 369 Backups 370 Website activities 373 Path and Pathauto 374 Search engine optimization and website promotion 379 Updates 382 Summary 386 Appendix: Leveraging jQuery 387 jQuery Basics 387 jQuery in action 390 Index 393 Introduction to Drupal Until quite recently, the most important thing a newcomer to the Web could do in order to prepare for building a website was to buy a book on how to learn programming in any one of the major web-centric languages such as PHP or Perl. The not inconsiderable task of learning the niceties of the chosen language to a respectable degree would consume a fair chunk of time and patience. Once our hapless newcomer had sufficient mastery of the fundamentals, applying that knowledge to program efficiently and reliably, with the tenacity to stick with a job until the site was developed, could arguably be described as a Herculean accomplishment. This state of affairs is, and quite rightly should be, entirely unacceptable to someone like yourself. It's like forcing lawyers to learn the intricacies of architecture, construction, and masonry simply because they require a courtroom to work in. It should be quite apparent that separating the technical task of developing the software for a website, from the function of that website is a very sensible thing to do; the main reason being that it allows people to focus on what they are good at without them having to devote time and energy to becoming good software developers too. It's not surprising then, that in recent years the open source community has been hard at work pulling the programming world out of the software dark ages by providing us with flexible frameworks for building web-based enterprises. These frameworks free website creators from the intellectual burden of learning software development ideas and concepts, allowing them instead to focus more on goal/ business-oriented configuration and customization tasks. Introduction to Drupal Drupal is one such result of this software development evolution, and this book seeks to provide you with the fundamental information needed in order to use it effectively. Because this book focuses more on beginner-level aspects of working with Drupal, you will be pleased to know that there will be little to no coding involved—you're not required to learn how to develop Drupal modules from scratch, for example. That's not to say this book will be elementary; on the contrary, the knowledge gained here will enable you to tackle problems beyond the scope of this material with confidence. To further consolidate your learning and expand on the practical aspect of the various topics covered throughout the book, each chapter will have an associated self-marking online quiz with additional exercises available at the author's website: http://www.siteprebuilder.com. It is highly recommended you take advantage of this additional resource to get the maximum benefit from this book. Before we begin building anything that resembles a website, I'm sure you have plenty of questions about the how, what, where, and why of Drupal. Consequently, this chapter will not only provide a backdrop for the rest of the book, but will also serve as an introduction to the technology as a whole, incorporating brief discussions on the following topics: • Drupal—an overview • How Drupal came to be • What Drupal has to offer • Uses of Drupal • The Drupal community • The Drupal license • The server environment • Obtaining and installing XAMPP (Apache, MySQL, and PHP) • Obtaining and installing Drupal • A short tour of Drupal Before we begin, there is one crucial bit of advice to be given: Ensure that you have access to a good, preferably broadband Internet connection, as you will be downloading a fair amount of software. [ 8 ] Chapter 1 If you already have a development environment set up and running, feel free to skip the web server sections and move to the Obtaining and Installing Drupal section. Drupal—an overview Drupal is an Open Source Content Management System. If you are new to both computing and Drupal, then this probably doesn't clear things up very much. First of all: The term open source describes software whose source code is made available, most often subject to certain conditions, for use or modification by users or other developers, as they deem fit. The specific conditions under which Drupal is made available will be scrutinized more closely in the section The Drupal license later in this chapter. Besides that, what open source means for someone who intends to make use of Drupal is that there is no obligatory payment required for this unquestionably valuable software. You also join a large community (also to be discussed later in this chapter) of Drupal users, developers, and administrators who subscribe to the open source philosophy—in other words, someone out there will probably be willing to spend time helping you out, should you get stuck. That's a pretty good deal for those who are still not convinced about open source technologies as a whole—not only do we not have to develop the entire site ourselves, but we also get to take advantage of the collective wisdom of thousands of other people. Is there anything else we can say about open source? Sure, with an active community like the one associated with Drupal, development advances rapidly and flexibly because any problems can be spotted early and dealt with effectively. This means that you can expect a high level of stability, security, and performance from Drupal websites. OK, but what is the Content Management System (CMS) part all about? A content management system is software that facilitates the creation, organization, manipulation, and removal of information in the form of images, documents, scripts, and plain text (or anything else for that matter). [ 9 ]

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.