Mastering Drupal 8
eBook - ePub

Mastering Drupal 8

Chaz Chumley, William Hurley

Share book
  1. 456 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Drupal 8

Chaz Chumley, William Hurley

Book details
Book preview
Table of contents
Citations

About This Book

Mastering Drupal can lead to a mighty website - discover what Drupal 8 can really do with hidden techniques, best practices, and more!About This Book• The most up-to-date advanced practical guide on Drupal 8 with an in-depth look at all the advanced new features such as authoring, HTML markup, built-in web services, and more• If you are looking to dive deep into Drupal 8 and create industry-standard web apps, then this is the ideal book for you• All the code and examples are explained in great detail to help you in the development processWho This Book Is ForThis book is ideally suited to web developers, designers, and web administrators who want to dive deep into Drupal. Previous experience with Drupal is a must to unleash the full potential of this book.What You Will Learn• Discover how to better manage content using custom blocks and views• Display content in multiple ways, taking advantage of display modes• Create custom modules with YAML and Symfony 2• Easily translate content using the new multilingual capabilities• Use RESTful services and JavaScript frameworks to build headless websites• Manage Drupal configuration from one server to another easilyIn DetailDrupal is an open source content management system trusted by governments and organizations around the globe to run their websites. It brings with it extensive content authoring tools, reliable performance, and a proven track record of security. The community of more than 1, 000, 000 developers, designers, editors, and others have developed and maintained a wealth of modules, themes, and other add-ons to help you build a dynamic web experience.Drupal 8 is the latest release of the Drupal built on the Symfony2 framework. This is the largest change to the Drupal project in its history. The entire API of Drupal has been rebuilt using Symfony and everything from the administrative UI to themes to custom module development has been affected.This book will cover everything you need to plan and build a complete website using Drupal 8. It will provide a clear and concise walkthrough of the more than 200 new features and improvements introduced in Drupal core. In this book, you will learn advanced site building techniques, create and modify themes using Twig, create custom modules using the new Drupal API, explore the new REST and Multilingual functionality, import, and export Configuration, and learn how to migrate from earlier versions of Drupal.Style and approachThis book takes a practical approach with equal emphasis on examples and illustrative screenshots.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Drupal 8 an online PDF/ePUB?
Yes, you can access Mastering Drupal 8 by Chaz Chumley, William Hurley in PDF and/or ePUB format, as well as other popular books in Computer Science & Content Management Systems. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781785886256
Edition
1

Content Types, Taxonomy, and Comment Types

One of the more powerful capabilities of Drupal is the ability to create custom content types. Often referred to as a node, we can think of Content types as containers for holding content that has been defined with specific fields, such as a title and a body. However, we are not limited to only those two fields. We can pretty much add as many fields as needed based on how the content itself has been defined.
Something new to Drupal 8 is the Comment field, which can be added to content types, allowing users to comment on the content. Drupal provides this ability out of the box as part of the core with the ability to add Comment types that can have fields of their own. We will look at the default configuration and how to customize comments.
We can also add fields to tag, categorize, or classify content, known as Taxonomy. Categorizing content using various terms allows us to enhance content that can then be attached to content types as a term reference.
To help us master Content types, Comment types, and Taxonomy, we will look at the following:
  • Exploring content types
  • Managing fields
  • Creating custom content types
  • Adding fields
  • Taxonomy, vocabularies, and terms
  • Introduction to Comment types
  • Working with form and content display
  • Using Drupal Console to generate content

Assumptions

Mastering Drupal 8 assumes that you are already running a local AMP stack and are familiar with installing Drupal using the standard means of downloading, setting up a database, configuring a localhost, and completing the browser-based install. In Chapter 1, Developer Workflow, we walked through quickly installing Drupal using Composer, Drush, and Drupal Console. Before continuing, ensure that you have a working AMP stack and are comfortable working within the command-line interface using a Terminal window.

Exploring Content types

In most cases, our first glimpse of content types comes from the two default Content types that Drupal configures as part of the standard install: Article and Basic page.
We can navigate to Content types by directly entering /admin/structure/types or by using the Administration toolbar and clicking on Manage | Structure | Content types:
The Content types page lists all content types, including their name and description. From this page, we can add, edit, and manage content types along with their respective fields and displays. Currently, our Content types consist of Article and Basic page.
To get a better look at the makeup of a content type, we can view the Basic page content type by selecting the drop-down button and choosing Edit:
The Edit screen defines the configuration of a content type by providing a Name, a Description, and four subsections that handle various settings.

Submission form settings

Submission form settings allow us to define the Title field label, specify whether content can be previewed before saving new nodes, and specify any submission guidelines we want to provide to users:

Preview before submitting

The Preview before submitting option provides two functions:
  • Appearance of a Preview button when creating a new node
  • Ability to switch between various displays of the content
If we navigate to the Add content page by entering /node/add/page or by using the Admin toolbar and clicking on Manage | Content, selecting Add content and then Basic page, we can create our first Basic page and preview the content in it:
On the Create Basic page screen, we will need to enter the following information:
  • Title*: About Us
  • Body: Add some default Lorem Ipsum using http://www.lipsum.com/:
With our content added, we can select the Preview button to view our content with the ability to change the View mode of how the content is displayed:
The display modes enabled on each content type will determine what choices are available in the View mode dropdown. For our example, we can switch between the Default and Teaser displays. Once we are done previewing the con...

Table of contents