Drupal 6 Content Administration Maintain, add, and edit the content of your Drupal site with ease J. Ayen Green BIRMINGHAM - MUMBAI This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Drupal 6 Content Administration Copyright © 2009 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, Packt Publishing, nor its dealers or 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 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: June 2009 Production Reference: 1190609 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847198-56-3 www.packtpub.com Cover Image by Parag Kadam ([email protected]) This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Credits Author Editorial Team Leader J. Ayen Green Akshara Aware Reviewers Project Team Leader Edward Peters Priya Mukherji John K. Murphy Project Coordinator Zainab Bagasrawala Acquisition Editor David Barnes Proofreader Dirk Manuel Development Editor Dilip Venkatesh Production Coordinator Shantanu Zagade Technical Editor Hithesh Uchil Cover Work Shantanu Zagade Copy Editor Leonard D'Silva Indexer Monica Ajmera This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 About the Author J. Ayen Green is a software and web site developer, writer, and poet. He is the chief software architect at Ayen Designs. He and his wife, Sofía-Aileen, make their home in New York City. Some might look at writing a technical book as paint-by-numbers as compared to the oil painting of a novel. With no intention of minimizing the talent needed for the latter, I have to argue that keeping a reader's interest is far easier when writing about a serial killer appearing in a doorway, than it is while writing about HTML tags. That said, it's been an enjoyable experience, and I'd like to take the time to thank the people responsible for that. My wife, Sofia-Aileen, handled her near-widow status over the past several months with an aplomb that created a stress-free work environment for me. I hope she didn't get too used to being 'single'. The experience of working with Frank Bozak, the owner of the web site MusicToHealBy.com, the example in this book, was what one dares to hope for from a composer of music for the soul. He's been patient, enthusiastic, and receptive, eagerly anticipating the climax. It takes much longer to finish when you have to stop and write about each step along the way. The staff at Packt are a delight to work with. In addition to the nameless army out there who make things happen, my thanks go out to David Barnes, Dilip Venkatesh, Zainab Bagasrawala, Abhijeet Deobhakta, and Hithesh Uchil for their dedication to producing the best product while keeping the writer alive, as well as to John K. Murphy and Edward Peters for a great job as technical reviewers. Finally, I must not fail to mention the enormously talented designers, coders, and technical writers who continue to make Drupal one of the best software titles ever released. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 About the Reviewers Edward Peters has worked for all of his adult life with Initiatives of Change (IofC), an international trust-building network (www.iofc.org). Between 2002 and 2008 he managed IofC's global Internet operation, servicing the needs of activists in many countries and many languages. In 2008, he oversaw the move of the organization's proprietary Web CMS into the Drupal framework—a technically-challenging task, given the objective of achieving a multi-lingual, multi-site system running off one codebase and one database, with user and content sharing across all sites. Edward also does freelance web development work for a number of small clients (www.edwardpeters.co.uk) and is moving several of them into the Drupal framework. He attended DrupalCons in Boston and Washington D.C., and is enthusiastic about Drupal and the Drupal community. He served as a technical reviewer for another Packt publication, Learning Drupal 6, by Matt Butcher. John K. Murphy is a graduate of the University of West Virginia and has been wrapped up in computers and software development since the 1980's. When he is not buried in a book or jumping out of an airplane, he works as an IT consultant. John lives with his wife and two children in Pittsburgh, PA and is currently obsessing about the Internet of Things. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 This book is dedicated to Scott Corley, one of those people who can see the forest for the trees. He's rescued me more than once, but most notably the first time, in college, when, with his gentle and diplomatic flair, he remarked, "Hey [expletive deleted], have you noticed that you're busting your butt in chemistry, and meanwhile you're acing the computer stuff without studying?" Thanks, Fonzo. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Table of Contents Preface 1 Chapter 1: The Grand Tour 7 What will I learn? 7 What is Drupal? 7 What is a Content Management System? 8 Who is the target reader? 8 What will I do in the chapters? 9 A guided tour of Drupal 9 The Drupal front end 10 The Drupal back end 12 Create content 13 Content management 13 User management 14 Reports 15 Site building 15 Site configuration 16 Summary 16 Chapter 2: Content Creation 17 What you will learn 17 What you will do 18 Understanding content in Drupal 18 What is content? 18 Node Content types—the Story 19 Activity 2.1: Creating a Story 20 Activity 2.2: Editing Node Content 24 Content creation form fields 26 This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Table of Contents Node Content types—Page 29 Activity 2.3: Creating a Drupal Page with a Rich Text Editor 29 Permissions in Drupal 33 Summary 34 Chapter 3: Content Seasoning 35 What you will learn 35 What you will do 35 Understanding Teasers 36 Activity 3.1: Creating a Teaser 36 Activity 3.2: Creating an external text link 42 The anatomy of a link 44 Using images in content 45 Activity 3.3: Working with images in content 45 Activity 3.3a: Uploading and embedding an image 46 Inserting an image if you don't have an editor 49 Activity 3.3b: Creating an image link 50 Embedding audio in Node Content 52 Activity 3.4: Adding audio content 52 Linking to downloadable content 55 Activity 3.5: Providing a link to downloadable content 55 Embedding video in Node Content 60 Activity 3.6: Adding video content 60 Summary 62 Chapter 4: Advanced Content Editing 63 What you will learn 63 What you will do 64 Enhancing layouts with HTML and CSS 64 HTML and tables 64 CSS in Drupal 65 Activity 4.1: Adding a CSS file to a theme 66 Activity 4.2: Creating a CSS file 66 Activity 4.3: Creating an 'include' file 67 Activity 4.4: Creating the Node Content header 70 Activity 4.5: Creating the Node Content Body 73 Revisions 80 Activity 4.6: Creating a Revision 80 Summary 82 Chapter 5: Making Content Findable 83 What you will learn 83 What you will do 84 [ ii ] This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423