Drupal 8 Quick Start Guide
eBook - ePub

Drupal 8 Quick Start Guide

Get up and running with Drupal 8

J. Ayen Green

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

Drupal 8 Quick Start Guide

Get up and running with Drupal 8

J. Ayen Green

Book details
Book preview
Table of contents
Citations

About This Book

Your step by step guide with easy to follow instructions for navigating Drupal 8

Key Features

  • Build a great Drupal website easily
  • How to structure, create and maintain different types of content
  • Design roles for secure editing of your site

Book Description

Drupal is a powerful content management platform, flexible enough to accommodate almost any content requirements. This flexibility comes with a cost: complexity. Drupal 8 Quick Start Guide will clear your path from installation to a building usable site in minutes, and to a customized site in one sitting.

You will begin with installation of Drupal and going through the main sections of the Drupal UI. Then, you will create a content type that describes its content, which simplifies the act of creating and editing the actual content later. You will learn about user roles, using real-world examples. This will help you to learn how to design roles, and how to assign appropriate permissions to them. Next, you will learn to use the WYSIWYG editor, configure it for other roles, navigate the various fields on the content creation form, and publish content.

To begin to appreciate the flexibility and expandability of Drupal, you will make use of popular content-focused modules that extend Drupal's power. You will learn how to expand your market to other readers directly and through other sites by configuring content and UI translations and creating a View that provides an RSS feed. Finally, you will put everything together by customizing the home page for your new website.

What you will learn

  • Create and customize Drupal structures, such as menus, tags, and content categories
  • Extend Drupal's capabilities with add-on modules
  • Administer site users, their roles, and the actions to which they are granted access
  • Understand user roles and permissions
  • Create, edit, and publish content
  • Use Views for custom content selection and display
  • Expand your audience with custom RSS feeds
  • Configure a home page with meaningful sections for a better UX

Who this book is for

This book is for content administrators, developers, site builders and administrators who are new to Drupal 8.

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 Drupal 8 Quick Start Guide an online PDF/ePUB?
Yes, you can access Drupal 8 Quick Start Guide by J. Ayen Green in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Development. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781789342932
Edition
1

Structuring Content Types

In Chapter 1, Finding Your Way Around Drupal, we learned what Drupal is and how to install it. This chapter will explore the fundamentals of Drupal content types, and the formats that define what information is saved with each piece of content. Upon reading this chapter, you will learn about content types and fields, creating a content type, adding fields to a content type, customizing the form used to enter content, and customizing the way the content is displayed.

What is content?

We all know what content is...sort of. This book is made up of content. This chapter contains content, as does this section within this chapter. The more important question is: what is it in the context of Drupal? This question is best answered with the home page as an example, because you'll know it when you see it!
The following screenshot shows a piece of content that I added to the site, in the main content area, with a thick rectangle around it:
When rendered and displayed in the browser, it's simply content, but up until that point, it is content of a certain type, of a content type, also known in Drupal as a node bundle. Does Drupal look at this content simply as:
Chapter 2 - Understanding Content Types
We all know what content is ... sort of. This book is made up of content. This chapter contains content, as does this section within the chapter. The more important question is, what is it in the context of Drupal? The question is best answered with the home page as an example, because you'll know it when you see it.
No, content is stored within Drupal in a way that facilitates selecting it based on almost any criteria you wish.
Let's take a look at the database for a moment. This isn't something that you need to learn, but it's good for illustration purposes. If we were to look at the main identifying information for this piece of content within the Drupal database, we would see this:
+-----+------+---------+--------------------------------------+----------+
| nid | vid | type | uuid | langcode |
+-----+------+---------+--------------------------------------+----------+
| 1 | 3 | article | 6166dc8e-1c64-4897-807e-7c535934f616 | en |
+-----+------+---------+--------------------------------------+----------+
You can see this in the article value in the type column, which contains the content type in this table. "Article" is the content type of our content. Let's leave the database behind and look at our content and its content type in the way that you will use it, via the user interface (UI).
In the Drupal documentation, you will often find a URL specified in an abbreviated manner, omitting the domain name to avoid confusion since most users will be using different domain names, so instead of mysite.com/page1 you might simply see /page1.
One of the pages used most often by a content editor is the content administration page. We'll begin there by clicking the Content link in the admin menu, which will take us to admin/content, as shown in the following screenshot:
As you can see in the preceding screenshot, our content is listed, its title is on the left, and the type given is Article. We will learn more about the use of this page in Chapter 4, Creating and Editing Content, but for now we want to use it to lead us to the page on which we can edit our content. Let's click the Edit link at the opposite end of the row from the content title, which will display a node edit form for the content, as shown in the following screenshot:

Content as fields

We sometimes tend to think of content as a big block of body text, but content can be stored as discreet fields so that important elements can be easily accessed and properly formatted:
You can see the same content in this form as you did on the page. However, here you also see the fields that hold that content. The content title is in a field labeled Title, and the main text is in a field labeled Body. There are two additional fields that are not being used by this particular piece of content: a field for categories, labeled Tags, and one that is used for attaching an image to the content, labeled Image.
By having a Title field and a Body field, both the user and Drupal understand that the information in each is separate from the other. This doesn't mean that they cannot be displayed together, but there are many reasons why we may want to be able to differentiate them.
For example, when this content was displayed on the homepage, the title and the body text were formatted differently. Another example is that we might want to have Drupal provide us with a list of content titles. In both examples, it is important for Drupal to be able to determine which part of the content is the title. If all of the content in the piece was thrown together, there would be no way for Drupal to know where the title ends and the body text begins. Having them in separate fields removes any ambiguity.
So, we have seen what the content looks like when separated into separate fields. But where do the fields come from? How does Drupal know which fields to offer to receive our input? Let's take a look at that next.

Understanding content types

A content type is essentially a collection of fields used to hold the various items that together form the whole of the content. In the case of the piece of content that we have been using, it is an example of the Article content type, which is one of the two content types that are present when you first create a new Drupal site, with the other being the Page content type.
If you think of a company's job application, every application contains the same fields for entering information, even though the information differs from one to another. In this example, the job application is a content type. Let's take a look at the Article content type in terms of how Drupal provides it.
To navigate via the admin menu, click Structure. Then, on the next page, click Content types, which will lead to a page that you can also reach via the browser instead at /admin/structure/types, as shown in the following screenshot:

Defining the content type

We'll now take a look at the content type definition. To start, rather than click on the default choice of Manage fields, click the arrow next to that and select Edit:
Let's take a brief look at the settings in the preceding form:
  • Name: This is the plain language name that the content type will be identified with. In this case, this is Article. To the right of ...

Table of contents