THE EXPERT’S VOICE® IN WEB DEVELOPMENT Beginning Backdrop CMS — Todd Tomlinson Beginning Backdrop CMS Todd Tomlinson Beginning Backdrop CMS Todd Tomlinson Tigard Oregon, USA ISBN-13 (pbk): 978-1-4842-1969-0 ISBN-13 (electronic): 978-1-4842-1970-6 DOI 10.1007/978-1-4842-1970-6 Library of Congress Control Number: 2016943317 Copyright © 2016 by Todd Tomlinson This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Exempted from this legal reservation are brief excerpts in connection with reviews or scholarly analysis or material supplied specifically for the purpose of being entered and executed on a computer system, for exclusive use by the purchaser of the work. Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher's location, in its current version, and permission for use must always be obtained from Springer. Permissions for use may be obtained through RightsLink at the Copyright Clearance Center. Violations are liable to prosecution under the respective Copyright Law. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director: Welmoed Spahr Acquisitions Editor: Ben Renow-Clarke Development Editor: Matthew Moodie Technical Reviewer: Eric Goldman Editorial Board: Steve Anglin, Pramila Balen, Louise Corrigan, James DeWolf, Jonathan Gennick, Robert Hutchinson, Celestin Suresh John, Nikhil Karkal, James Markham, Susan McDermott, Matthew Moodie, Ben Renow-Clarke, Gwenan Spearing Coordinating Editor: Nancy Chen Copy Editor: Tiffany Taylor Compositor: SPi Global Indexer: SPi Global Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected] , or visit w ww.springer.com . Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail [email protected] , or visit w ww.apress.com . Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at w ww.apress.com/bulk-sales . Any source code or other supplementary materials referenced by the author in this text is available to readers at www.apress.com . For detailed information about how to locate your book’s source code, go to www.apress.com/source-code/ . Printed on acid-free paper To my beautiful and amazing wife Misty, who cheerfully sacrifices time together as I pursue my passion for writing. Contents at a Glance About the Author ...................................................................................................xvii About the Technical Reviewer ................................................................................xix Foreword ................................................................................................................xxi Acknowledgments ................................................................................................xxiii Introduction ...........................................................................................................xxv ■ Chapter 1: Introduction to Backdrop CMS .............................................................1 ■ Chapter 2: Creating and Managing Content ...........................................................7 ■ Chapter 3: Creating and Managing Users ............................................................23 ■ Chapter 4: Taxonomy ...........................................................................................35 ■ Chapter 5: Content Types .....................................................................................51 ■ Chapter 6: Creating Layouts ................................................................................77 ■ Chapter 7: Using Backdrop Themes ....................................................................89 ■ Chapter 8: Creating Menus ..................................................................................99 ■ Chapter 9: Backdrop Blocks ..............................................................................107 ■ Chapter 10: Views .............................................................................................115 ■ Chapter 11: Creating Pages ...............................................................................133 ■ Chapter 12: Backdrop Modules .........................................................................143 ■ Chapter 13: Anatomy of a Module .....................................................................149 ■ Chapter 14: Creating Themes ............................................................................155 ■ Chapter 15: Multilingual Capabilities ................................................................165 v ■ CONTENTS AT A GLANCE ■ Chapter 16: Using Git .........................................................................................177 ■ Chapter 17: Putting It All Together ....................................................................185 ■ Chapter 18: Administering Your Backdrop Site .................................................191 ■ Chapter 19: Creating a Blog Site .......................................................................205 ■ Chapter 20: Building a Company Site ................................................................219 ■ Appendix A: Installing Backdrop .......................................................................243 ■ Appendix B: Contributing to Backdrop ..............................................................251 ■ Appendix C: Additional Resources .....................................................................253 Index .....................................................................................................................255 vi Contents About the Author ...................................................................................................xvii About the Technical Reviewer ................................................................................xix Foreword ................................................................................................................xxi Acknowledgments ................................................................................................xxiii Introduction ...........................................................................................................xxv ■ Chapter 1: Introduction to Backdrop CMS .............................................................1 Content Management Systems ........................................................................................1 Backdrop CMS ........................................................................................................................................2 Backdrop Core ........................................................................................................................................2 Contributed Modules ..............................................................................................................................3 Backdrop Layouts and Themes...............................................................................................................3 Creating Content ..............................................................................................................4 Summary ..........................................................................................................................6 ■ Chapter 2: Creating and Managing Content ...........................................................7 Understanding the Basics ................................................................................................7 Creating Content in Backdrop ..........................................................................................7 Teasers and Full Nodes.........................................................................................................................11 Editing Content ...............................................................................................................11 Other Content Options ....................................................................................................13 Publishing Options ................................................................................................................................13 Authoring Information ...........................................................................................................................14 Revision Information .............................................................................................................................15 vii ■ CONTENTS URL Settings .........................................................................................................................................17 Comment Settings ................................................................................................................................18 Deleting Content .............................................................................................................20 Finding Content ..............................................................................................................21 Summary ........................................................................................................................22 ■ Chapter 3: Creating and Managing Users ............................................................23 Users, Roles, and Permissions .......................................................................................23 User Accounts ................................................................................................................24 Confi guring User Account Settings .................................................................................24 Creating Roles ................................................................................................................25 Assigning Permissions ...................................................................................................27 Creating User Accounts ..................................................................................................29 User-Generated Accounts ...............................................................................................31 Resetting Users’ Passwords ...........................................................................................32 Summary ........................................................................................................................33 ■ Chapter 4: Taxonomy ...........................................................................................35 Taxonomy Overview .......................................................................................................35 Using Tagging to Categorize Content ....................................................................................................35 Using Structured Taxonomy ..................................................................................................................38 Implementing Structured Taxonomy ..............................................................................38 Creating Vocabularies ...........................................................................................................................39 Assigning a Taxonomy Vocabulary to a Content Type .....................................................42 Selecting a Taxonomy Term When Creating Content ......................................................44 Creating Human- and Search Engine–Friendly Lists ......................................................47 Hierarchical Terms .........................................................................................................47 Assigning More Than One Vocabulary ............................................................................49 Summary ........................................................................................................................50 viii ■ CONTENTS ■ Chapter 5: Content Types .....................................................................................51 The Page and Post Content Types ..................................................................................51 Defi ning a Custom Content Type ....................................................................................52 Creating a Custom Content Type ....................................................................................52 Customizing Your Content Type ......................................................................................59 Other Field Types ............................................................................................................64 List Fields .............................................................................................................................................65 File Uploads ..........................................................................................................................................68 Text Area ...............................................................................................................................................71 Numeric Fields and Other Field Types ..................................................................................................72 Formatting the Input Form for a Custom Content Type ..................................................72 Formatting the Output of a Custom Content Type ..........................................................73 Summary ........................................................................................................................75 ■ Chapter 6: Creating Layouts ................................................................................77 Default Layouts ..............................................................................................................77 Creating Custom Layouts ...............................................................................................79 Installing Other Layouts..................................................................................................85 Creating a Custom Layout Template ...............................................................................85 Creating the Layout’s .info File .............................................................................................................86 Creating the Layout’s .tpl.php File ........................................................................................................86 Creating the Layout’s .css File ..............................................................................................................88 Changing Layouts ...........................................................................................................88 Summary ........................................................................................................................88 ix