39,59 €
Create complex websites quickly and easily using the building blocks of Drupal 8, the most powerful version of Drupal yet
If you want to learn to use Drupal 8 for the first time, or you are transitioning over from a previous version of Drupal, this is the book for you. No knowledge of PHP, MySQL, or HTML is assumed or required
Drupal 8 sets a new standard for ease of use, while offering countless new ways to tailor and deploy your content to the Web. Drupal 8 allows user to easily customize data structures, listings, and pages, and take advantage of new capabilities for displaying data on mobile devices, building APIs, and adapting to multilingual needs.
The book takes you step by step through building a Drupal 8 website. Start with the basics, such as setting up a local “stack” development environment and installing your first Drupal 8 site, then move on to image and media handling, and extending Drupal modules. Push your knowledge by getting to grips with the modular nature of Drupal, and learning to extend it by adding new functionalities to create your new modules. By the end of the book, you will be able to develop and manage a modern and responsive website using Drupal.
This is an absolute beginners' guide, providing step-by-step instructions to help you learn Drupal 8 from scratch.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 273
Veröffentlichungsjahr: 2016
Copyright © 2016 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 authors, 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: January 2016
Production reference: 1270116
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-875-1
www.packtpub.com
Authors
Nick Abbott
Richard Jones
Reviewers
James Roughton
Tracy Charles Smith
Michelle Williamson
Commissioning Editor
Andrew Duckworth
Acquisition Editor
Richard Brookes-Bland
Content Development Editor
Dharmesh Parmar
Technical Editor
Anushree Arun Tendulkar
Copy Editor
Charlotte Carneiro
Project Coordinator
Mary Alex
Proofreader
Safis Editing
Indexer
Tejal Daruwale Soni
Production Coordinator
Melwyn Dsa
Cover Work
Melwyn Dsa
Nick Abbott is the head of training at iKOS. Nick started his digital life in 1981 working on an ICL 2904 mainframe, a Commodore PET, and a Commodore VIC20. After the ritual stint in BASIC, he moved on to writing games in Z80 and 6502 assemblers, hardware interfacing, and many happy hours creating business solutions with the BBC Micro based around the Acorn View family. Old but not obsolete. He graduated with a first class degree in applied physics in the late 1980s, and he worked in IT and education right up until he joined iKOS in 2008.
Richard Jones is the Technical Director and co-founder of iKOS (now part of the Inviqa group)—a European digital agency specializing in Drupal. Richard's first computer was an 8-bit BBC Master and this began his journey into computing proper. Indeed, his first introduction to working with Nick was by way of a school database project using the then legendary Acorn ViewStore package—way ahead of its time as an EPROM-based offering. He graduated with a first class degree in mechanical engineering in 1996 and has been working with various web technologies ever since.
They have both worked exclusively with Drupal on all their projects for 7 years. Richard and Nick have been collaborating on projects since the mid-1990s and have a great balance of skills between them that mean the first draft of collaborative work will have already been through many critical rewrites.
They both live in the Drupal ecosystem on a daily basis and Getting Started with Drupal Commerce—the first title they worked on with Packt Publishing—was well received.
James Roughton is an experienced safety professional with in-depth knowledge of the use of social media to help improve productivity. He is an accomplished speaker, author, and writer, and he develops and manages his own websites that provide a resource network for small businesses at http://safetycultureacademy.com/.
Three of his most notable books include Safety Culture: An Innovative, Leadership Approach, Developing an Effective Safety Culture: A Leadership Approach, and Job Hazard Analysis: A Guide for Voluntary Compliance and Beyond. He is an active board member and web master for the Georgia Conference—www.georgiaconference.org.
He was a President of the Georgia ASSE; Chair of Gwinnett Safety Professionals, and adjunct Professor of Safety Technology at Lanier Tech, Georgia Tech, and currently adjunct Professor at Columbia Southern University. He has received awards for his efforts and was named the Georgia Chapter ASSE Safety Professional of the Year 1998-1999. He also won the Project Safe Georgia award, 2008, and received the Georgia Safety, Health, and Environmental Conference's Earl Everett distinguished Service award, 2014.
Tracy Charles Smith is currently working as a project manager for Phase2, based out of Alexandria, Virginia. Tracy has experience in programming, database design, and project management. He has been developing web applications since 1999 and has used various languages and technologies including ColdFusion and PHP. Before becoming a project manager, Tracy was a senior developer working on large website implementations using Drupal as a platform.
In addition to reviewing Learning Drupal 8, Tracy authored Drupal Intranets with Open Atrium in 2011 and has reviewed several other books, including ColdFusion 9 Developer Tutorial. Tracy's entrepreneurial spirit has been a key component to Tracy's success in interacting with clients and team members on business and user-experience related technology solutions. In fact, he used that passion to start his own technology consulting firm called Alpha Geek Tech, LLC. He also served as a technology director for Quiddities Dev, Inc, in Santa Cruz, CA, before moving to the DC area to join Phase2. He earned a BS degree in computer information systems and business administration from Wingate University.
Michelle Williamson got her start in Drupal with version 5 and was immediately hooked by the learning curve and community. She currently works at Mediacurrent, a leading distributed Drupal agency, as Accessibility Lead. She spends her days building Drupal sites and making them more usable and friendly to people with disabilities. She is especially excited about the release of Drupal 8 and the various accessibility enhancements that come with it.
When not in front of a computer, Michelle is usually taking her puppies on hikes, cooking nutritious food, or has her nose in a Kindle.
For support files and downloads related to your book, please visit www.PacktPub.com.
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.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read 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 9 entirely free books. Simply use your login credentials for immediate access.
This book is designed to be an absolute beginners' step-by-step guide to learning Drupal 8.
Our aim was to write a book that explains what Drupal is and how to use it completely from scratch. We do not assume that the reader is familiar with any previous versions of Drupal, and we won't be referring to terms such as "Schema" and "MVC" in the assumption that the reader is necessarily already a web developer.
We have made every effort to keep the language as simple as humanly possible to illustrate every single step of the way so as to speed the would-be Drupal site builder on your way to building real state-of-the-art sites.
Chapter 1, Introduction, gives background information on Drupal and content management systems in general. Also some history on the Drupal project itself and how we got here.
Chapter 2, Installation, shows how to obtain a copy of Drupal 8 and install it on your own computer so you can get started on the rest of the chapters in this book.
Chapter 3, Basic Concepts, shows us each of the components to provide a better foundation for learning Drupal. This chapter also defines the terminology you will come across.
Chapter 4, Getting Started with the UI, walks you through the key parts of the standard Drupal 8 user interface (UI) focusing our on the Toolbar, the Administration menu and Shortcuts. This chapter is intended to provide you with a quick overview and much more detail and guided tutorial assignments will follow in later chapters.
Chapter 5, Basic Content, discusses basic content types defined in a standard Drupal 8 installation and how they can be used for a simple website.
Chapter 6, Structure, discusses how content can be structured once it has been created.
Chapter 7, Advanced Content, shows how to extend the basic concepts and create new content types, and why you might want to do this.
Chapter 8, Configuration, explains in detail each configuration option available in the standard Drupal 8 installation.
Chapter 9, Users and Access Control, shows how to control access to different areas of your Drupal site.
Chapter 10, Optional Features, presents various features of Drupal switched off in the default installation. This chapter explains what they are and what they do.
Chapter 11, Reports, shows the reports available in the standard installation and how you can use the data presented in it.
Chapter 12, Extending Drupal, discusses the modular nature of Drupal and how you can extend it to add more functionality.
Chapter 13, Theming Drupal, gives an introduction to theming a Drupal site.
Chapter 14, Getting Support, shows how the Open Source Drupal Community works now that we have reached the end of the instructional part of the book. However Drupal 8 is an extensive software framework and you should not expect to find all of the answers in a "Learning" book. In this chapter we discuss how the Open Source Drupal Community works and how you can engage with the community to get help and support for your Drupal project.
In order to follow along with this book you will need to install Drupal on your own development environment. The steps to do this are given in Chapter 2, Installation. A laptop or desktop machine should be sufficient, you will not need a commercial web server to complete the exercises detailed in the chapters to follow. Drupal works in any modern browser. You will not need to edit any PHP code to complete the chapters in this book.
If you want to learn Drupal 8 for the first time, or you are transitioning over from a previous version of Drupal, this is the book for you. The knowledge of PHP, MySQL, or HTML is not required.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The site-specific settings file is called settings.php and can be found in the default folder."
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Select the language you want to install and click on Save and continue."
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 disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in 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 at 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.
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/Learning_Drupal_8_ColoredImages.pdf.
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 could 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/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted 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.
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.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.
Back in the old days (pre-1995ish), we used to have to download special software to our computers in order to buy things, look up things, and build things.
"Madness", I hear you say.
Of course those days are long gone. Nowadays, we all simply expect to be able do everything we need using a web browser. To put it another way, we all expect everything presented to us in some form of "web technology". But, what does it really mean in simple terms?
You probably already know that all the web pages that are a part of our everyday lives are written in the language of HTML—Hyper Text Markup Language.
If you've ever dug a little deeper, you might also know that the styling of web pages—the colors, typography, layout, and so on are controlled by CSS—Cascading Style Sheets.
Add some JavaScript into the mix, and web pages become a bit more interactive with things popping up and dropping down all over the place to make the experience a bit richer.
So, there it is. As good today, as it's always been…
Traditionally, piecing this all together involved a pretty detailed understanding of each of the three parts—it was all a bit too technical for many; it meant becoming fluent in these new "languages"; it meant you had to be a "coder".
So, what is Drupal? Where does it fit into all this?
It can be difficult to put a label on what Drupal actually is, since it is many different things to different people. We could start talking about terms such as "PHP-based social publishing software" and "web application framework", but let's not get into all that.
All you really need to understand right now is that Drupal is your LEGO-like toolkit for piecing together HTML, CSS, and JavaScript to build great websites.
Drupal is a tool that equips anyone, regardless of their level of experience with web technologies, to build a state-of-the-art website. True to the founder's original vision of providing a website-building framework that can be used to spectacular ends without having to learn to code. You no longer need to know HTML, CSS, and JavaScript to create a real state-of-the-art website. Now, that sounds good.
Having set the scene, let's go back in time and discover how we got to Drupal 8.
We used to piece together our web pages using HTML tags and styles all mixed together with JavaScript, images, and other file assets such as PDFs, Flash animations, and finally, the content itself.
The design, functionality, and the actual content were all mixed together to create the pages. These pages were also "static", in the sense that they could never change. The only way to update the actual content of the pages and/or their layout, cosmetic style, and fancy interactive moving parts was to be a "coder" and do some technical editing. Nasty!
Originally proposed in 1994, it wasn't until the early 21st century (2001) that we managed to separate out web pages' style from their content with the introduction of CSS. Likewise, the fashion moved to splitting out the JavaScript code into separate, more manageable files too.
Even with this useful advance, the pages were still only static. What we were really seeking was a mechanism for having the actual content itself come from other dynamic sources and for the web pages to be generated on the fly. We needed to make our pages dynamic.
Then came a whole host of what we shall loosely refer to as code engines in various programming languages designed to achieve the dynamic approach: CGI, Perl, Python, PHP, Cold Fusion, ASP, JSP, Ruby, and numerous others.
Let's not worry about the technical differences between all these. What really matters here is that they all strived to meet the challenge of separating out the page structure, style, and content so that these elements could be organized in a more manageable fashion.
In all of the preceding approaches, instead of the content being embedded in the web page, it was now being stored in and retrieved from a database, and the HTML pages were being assembled on the fly from that data and a collection of site-themed elements. See the following for an illustration.
This means that our pages can rebuild themselves in response to users' input; communication became two-way between the users and the website. This was the birth of "Web 2.0".
Drupal employs one of the aforementioned languages, namely PHP, to build data-driven pages and so provide us with a neat, manageable split between content, configuration, user accounts, and media assets such as images, documents, and video.
PHP is a very widely used open source scripting language that is especially suited to web development because it can be embedded into HTML pages. PHP "pages" are essentially HTML pages with embedded programming code that reshapes the contents of the HTML page dynamically before you get to see it in your browser.
The PHP code is executed on the server, and it generates a complete HTML page, which is then sent to your browser. As far as you are concerned, the end result is a fully formed HTML page, and you have no evidence that it was constructed dynamically by PHP.
Drupal is the clever PHP that brings together the various assets to form the actual visible pages, which are then made available to us across the web using a web server.
Drupal is completely free and always will be. It is open source. It is a software that is not owned by anyone but is instead developed collectively by a community of people interested in continually improving it as a platform.
Let's dwell a moment on the term "open source" so as to be clear about what it really means.
The word "source" here refers to the actual original program code written by the author. Programmers who have access to a computer program's source code can improve the program by adding features to it or fixing parts that don't always work correctly. The open source license actively promotes collaboration and sharing. Anyone can make modifications to source code and incorporate these changes into their own projects. Thus, open source projects benefit from a potentially infinite number of "authors". However good we might think we are at developing software, the community is better!
The open source label itself was created at a strategy meeting held in early 1998 in Palo Alto, California.
It is important to understand that Drupal really is more than just the actual software. It is also a worldwide community of developers, designers, project managers, business innovators, technology specialists, and user-experience professionals. Community members all pull together to continually make Drupal ever more flexible, extensible, and standard compliant, so as to take advantage of emerging technologies. For a long time, the unofficial strapline of Drupal has been "come for the software, stay for the community," and this is certainly true in our experience.
So why does Drupal prosper and why is it steadily gaining momentum as the platform of choice for organizations large and small the world over? This question is answered in the following sections.
We've become used to a diet of multiple software platforms and technologies each with its own cost, interface, storage, and security issues. You may be all too familiar with statements, such as:
"We have multiple systems working here, only some of which seem to talk to each other"
"You want a blog? Use WordPress for that".
Attempting to integrate a range of technologies is usually an expensive and never-ending business, and the management of the middleware (yet more layers of software) required to glue them together is a sizeable debt to be repaid, often over and over.
With Drupal, you will find that you can do it all in one place and in a consistent, coordinated fashion.
"I had to start from scratch"
Anyone in the IT project business knows all too well that the underlying code can quickly become the reserve of the individual developer who actually wrote it. Often it is only when the particular individual leaves the company that the technical debt is realized. The developer may not have documented their approach, let alone the actual code that someone else inevitably has to take on. The legacy may contain all manner of unjustified assumptions, poor coding practices, "hidden features" (that is, bugs), and quick but irreversible fixes that close the doors to integration and further extension. All too often, in trying to deal with their inheritance, the new developer ends up re-inventing it all over again often with a new set of assumptions and with a potential new set of bugs.
With Drupal, you can at least be assured that the code has gone through a clearly defined community peer-review process, and opting to use the Drupal framework as the basis for building your solutions will go a long way to addressing concerns about the code quality and therefore technical debt.
"We can't seem to find quality Drupal developers"
However, we should not be naïve and pretend to ourselves that Drupal is the silver bullet we've all been waiting for. It comes with its own significant technical debt not least of which is the absolute necessity for having proper Drupal-savvy developers on your team. Drupal code is very framework specific, so one should not expect a competent PHP developer to be able to be truly effective with Drupal without an investment of time learning to understand how to properly work with the framework.
Drupal 8 initiatives to stay relevant such as its use of the PHP framework known as Symfony 2—essentially a collection of well-respected state-of-the-art PHP components—have gone a long way to make the underlying code more familiar to modern PHP developers who are used to working with modern object-oriented PHP. However, investment in learning the Drupal way is still crucial.
With its growing library of free extension modules, themes (pre-built skins), and sizable developer community, Drupal is still probably the wisest choice and the most future-proof content management framework around.
If you are considering adopting Drupal as your platform, then we strongly advise you to make certain that your developer team is professionally trained.
Think of Drupal as a gigantic LEGO construction kit for would-be site builders. Drupal site builders develop websites by piecing together Drupal modules. Each module is designed to solve a particular problem but in a Drupal-compliant way, so as to keep all the doors open to integrating with the enormous repository of other community-written modules that are out there.
When we plan to add a new feature to our website, the first step is to look around and see what's already been done by community members to see if "there's a module for that". For example, imagine that you want to create a community site where members can:
This can be done by simply performing the following steps:
