Home Web Development Drupal 8 Quick Start Guide

Drupal 8 Quick Start Guide

By J. Ayen Green
books-svg-icon Book
eBook $20.99 $13.99
Print $25.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $20.99 $13.99
Print $25.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
About this book
Drupal is a powerful content management platform, ?exible enough to accommodate almost any content requirements. This ?exibility 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 ?exibility 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.
Publication date:
October 2018
Publisher
Packt
Pages
128
ISBN
9781789340310

 

Chapter 1. Finding Your Way around Drupal

This chapter will take you step by step through the Drupal site installation process. Following that, we will take a quick tour of the Drupal administration interface. During the course of this chapter, you will learn about thefollowing topics:

  • How to navigate the Drupal installation script
  • How to log in to the Drupal administrative interface
  • How to navigate and use the administrative interface
  • Drupal-specific terms
 

Installing Drupal


Installing Drupal is a two-phase process. The first phase is the readying of the environment to host a Drupal website, and the second is running the installation script to create the website. Let's take a quick look at what Drupal is and the requirements for the first phase.

Readying the environment

Physically, Drupal is a collection of folders and files, most often found within a parent folder that is typically referred to as the Drupal root. Drupal also consists of a database, where the site's content and various settings are kept. 

 

 

The Drupal root will most often be situated on a computer known as a web server that may contain many websites, though the web server could also exist on a laptop for use in developing websites. The environment in which Drupal exists will consist of the following:

  • An operating system, which is usually Linux, but can be any another, such as Windows, OS X, or Unix
  • A web server, such as Apache or Nginx
  • A database, most often MySQL, which may be on the same server or on a separate database server
  • The PHP language

The environment in which Drupal exists is collectively referred to as a LAMP environment, which stands for Linux, Apache, MySQL, and PHP, though other combinations exist, such as WAMP for Windows rather than Linux.

Note

The subject of the overall installation actions needed before running the Drupal site installation process, such as readying the LAMP environment, downloading the Drupal code, and installing the symbiotic technologies used with it, is outside the scope of this book. 

To get started, an administrator should first have followed these steps, or similar:

Having done so, what exists now is the necessary environment for you to create your Drupal site. You might be thinking that the preceding steps have created the Drupal site already, but this isn't the case. Since I'm going to do this now, this is a good time to mention that my most often-used analogy of a website is a house. What the preceding steps did was select the location, prep the lot, run the utilities for it, pour the foundation, and ensure that you have the materials necessary to build the house. Now, we're going to build it. 

"Oh, no!" you might be saying, "does that mean I need to learn all that web programming stuff, like HTML?" Fear not. One of the magical things that Drupal does is create all of the geeky stuff that's necessary for a website. After following a few steps, you will have a "vanilla" Drupal site, unadorned and not customized very much, but present and totally usable. Yes, just like a house that might be built in a cookie-cutter fashion, you have the ability to choose the paint, carpet, tiles, curtains, and appliances to make it unique and best reflect your vision, but those customizations are a topic outside of the scope of this book, although we will select a few "appliances" later on.

Unlike a house, there's no cutting, nailing, or other labor-intensive things to be done here with the raw materials waiting for assembly—just a few simple steps. First, though, there are a few pieces of information that you will need to know about in order to answer the questions that are asked about the new site during Drupal's installation process:

  1. Which URL has been assigned to the site? If the site is on a remote server, it might be something with a familiar look, like http://www.mysite.com. On a local system, it could be something simple like http://mysite or even http://localhost.
  2. What will the Drupal admin username and password be? 
  3. What will the email address for the site be?
  4. What are the username and password for the database, and what is its name?

Note

If the site is not being accessed as a registered website, it is likely that an entry needs to be added to a file in your workstation's hosts file, which is the equivalent of a contact entry with the name you type and the address at which it can be found.

The installation process cannot be completed without the answers to these questions. Once you have them, we're ready to proceed!

 

 

We'll start by opening a browser. Any current version of the common ones, such as Chrome, Firefox, IE, Edge, or Safari, can be used. In the address bar, enter the URL that has been assigned to this site:

Note

The URL that I'll be using for this book is d8quickstart, and you will see this present in the address bar in any illustrations that contain one, such as image below. You will need to use the URL assigned for your site instead.

Running the Drupal installation script

This is the moment when you find out whether all of the pre-installation steps taken by your administrator were completed successfully. If so, you will see a screen similar to the following:

A variety of things can go awry at this point, and the reasons for this include the following:

  • The web server entry is misconfigured or pointing to the wrong folder
  • The URL doesn't match the one that was configured
  • The host's entry for the URL is needed but is missing or has been mistyped
  • The Drupal files aren't in the correct place, or the web server entry is pointing to the Drupal folder rather than the web/folder within it
  • The file permissions are incorrect

Hopefully, you will receive the page shown in the preceding screenshot; if not, the preceding issues can be quickly resolved so that you can.

You will notice that the URL in the address bar is different than the one you entered. When Drupal determines that the site has not been installed, which in this case is determined by there being no viable database, it redirects the request for the home page (the URL you entered) to the installation page, located at d8quickstart/core/install.php.

Let's take a look at some of the things on this first screen. The Drupal version number is given at the top left of the page; this is 8.5.4in my case. It is up to you regarding which version you install, but it should definitely be 8 dot something, and it is worth noting that installing older versions, such as installing 8.5.3 rather than the current (at the time of writing) 8.5.4, would risk using a version containing a security issue that has since been fixed. 

 

The default installation language is shown.

You can select a different language than that presented. Drupal offers dozens, but do continue with English if you want your screens to match the examples that are used in this book.

Lastly, the list of steps down the left-hand side are not clickable because they are used as a progress indicator rather than a menu. As you proceed through the installation, the current step will be highlighted, just like Choose language is now. Let's move on by clicking the Save and continuebutton.

An installation profile is a configuration or collection of settings and software that's predetermined to be used for a specific purpose. Currently, Drupal has only three available in a normal installation: Standard, Minimal, and Unami, with Standard being the default setting, and the one we want. From here, click the Save and continue button.

If Drupal finds the files and folders that it needs to continue, it will move quickly past the Verify requirements step to Set up database. Otherwise, it will display a list of the issues that need to be addressed before it can continue. Some issues that frequently arise from steps during the pre-installation that were missed or performed incorrectly include the following:

  • In the Drupal file folder structure, there is a default folder within a sites folder, and inside the default folder should be a files folder. It is not present in the Drupal installation files and needs to be created manually. Often, this step is missed, or the folder is created but in a way that will not allow Drupal to write to it.
  • The default sites folder contains a file called default.settings.php. That file needs to be copied within the same folder and named settings.php. This, too, is often missed, or the file is present but will not allow Drupal to write to it.
  • Missing PHP extensions, such as ext-gd. Messages of issues such as this should be referred to your server administrator.

Once things are as Drupal expects to find them, it will move on to inquiring about the database configuration:

It's time to make use of the database credentials that you obtained. In the text boxes provided, enter the database name, database username, and database password, and then click the Save and continue button.

At this point, Drupal will begin installing itself, entering configuration information into the database and initializing data structures. A meter will keep you informed of its progress, as shown in the following screenshot:

Once Drupal has installed itself, there is a final step in the process, that is, providing the site configuration. You will need the information that you obtained earlier to answer these questions:

Site information

The Site name that you enter will be the name Drupal identifies with the site, and the name that it will display if configured to show the site name rather than just a logo or logotype. This and any of the settings that you enter on this page can be changed at any time.

The Siteemailaddress is used to send contact messages when a contact form is enabled. 

Site maintenance account

The capability to perform various tasks in Drupal is provided to a user by way of permissions that are granted, not by username, but by user role. We'll discuss this topic more in a later chapter. For now, the main thing you need to know is that the user role with the most capability is Administrator, and of the administrators, there is a single superuser login that is granted every permission. This role is most often referred to as User 1 because this is always the first user that's configured for a site, and so receives that user ID.

The username, email address, and password entered here will be assigned to User 1. If this will not be you, and if you have not been given the credentials to use on behalf of the person it will be, make a note of the values that you enter so that they can use them to log in and change them.

Regional settings

Drupal creates log entries for certain events, and sends messages on behalf of the site, such as notifications of new content to subscribed users, login instructions for users receiving new accounts, and so on. The server itself might be located in one time zone, and may host several sites. The date and time on the computer might not necessarily be the same as that of the organization to which the site belongs. The location and time zone entered here are used to ensure that the log entries and communiques use the correct time.

Update notifications

Like any software, Drupal occasionally needs updating. Also, because much of its functionality comes via add-on modules and contributed modules, they occasionally need updating too, and each can have different update schedules or be updated on a completely ad hoc basis. Therefore, Drupal will perform a check on a daily basis to see if any new releases are available.

 

These checks are important, because the reason for the update can be to fix security-related issues. For that reason, it is normally good to keep the checkboxes checked. However, there are instances where there is no need to do so, for example, when there is an IT group that will be monitoring releases so that it isn't necessary for the site to do so, or in the case where the site is a local copy of a site used for development that will always match another site's versions. Again, the choices made here can be changed at any time, so if you're not certain, leave them selected.

Click the Save and continue button, and Drupal will render and display the new website for you!

Congratulations! How was that for a quick start? You are looking at a fully functional Drupal site. However, what is a content management site without content? Are you ready to continue? Let's move on and give you the grand tour.

 

The behind-the-scenes tour


Like entering any complex location without a map in hand—a mall, a metro system, an amusement park—Drupal can be daunting to find your way around. So, throughout the rest of this chapter, I will be your tour guide, mapping out Drupal for you.

 

 

The home screen on a new site is presented to you via a theme. Themes control where elements appear on the page, their size, their color, and other aspects of the user interface, or UI. The default theme for Drupal 8 is called Bartik. It is important to remember that the homepage can (and likely will at some point) look somewhat or very different as a result of any of the following changing:

  • Browser or browser version
  • Device type (for example, an iPhone instead of a desktop computer)
  • Theme
  • Site's homepage layout
  • User role permissions
  • Items being added to or removed from the menus

So, try not to fixate on the exact location or appearance of the page elements, but rather develop an understanding of what they are so that you know where you want to go or what function you want, regardless of the appearance:

 

The preceding screenshots have numbers to the left and right that identify functional areas of the page. Each is identified in a key in the following table. A longer description will follow:

Section

1

Administration menu

2

Branding

3

Tabs

4

System message area

5

Search widget

6

User menu

7

Main navigation

8

Content area

Administration menu

The administration menu, or admin menu, is typically only seen by users with the administrator role. Like any other Drupal menu, the entries displayed on it depend on the role of the user and the permissions assigned to that role. For example, someone with the role of editor might not see the choice for Extend, since that is associated with site administration. 

The Manage link acts as a toggle that alternately shows or hides the row below it that contains links to the major administrative management pages.

The Shortcuts link replaces the administrative management links with links that the current user has added as bookmarks. For example, if by clicking links on successive pages you reach a page five clicks later, rather than doing that every time you want to go to that page, you can add it as a shortcut.

The final link in that row is one for the current user's account, which leads to the user page. The user page has tabs through which the user's account settings, including password, can be managed, as well as any shortcuts the user has added. Depending on the site and how it has been customized, this is often the page from which a user can reach the user profile and edit those fields. The fields and an explanation of them is as follows:

  • Content leads to the content administration page on which content titles are listed and content can be managed. This will be covered more in Chapter 4, Creating and Editing Content.
  • Structure leads to a further menu from which various site structures can be managed. Those of interest to content editors include content types and taxonomies, which are discussed in Chapter 2, Structuring Content Types.
  • Appearance is where the installed site themes are listed and where they can be configured. A theme is a collection of files and settings that control the appearance of the site's pages. There are typically two themes that are applied to a site: the theme that visitors see, and the theme used for administrators accessing the site's backend.
  • Extend leads to the module management section. Modules are add-ons for Drupal that provide additional functionality (see Chapter 5, Making Drupal Even More Useful). Here, modules can be installed and uninstalled.
  • Configuration displays a menu of pages that serve as the primary administration portal, where many site settings are configured, such as the name of the site, which you provided during the install process. Here is a list of the various categories of settings, bearing in mind that the options presented are dependent on the user role:
    • Account settings: How user registration and account cancellation are handled, the content of system generated messages to users, whether a contact form is made available, and the role associated with site administrators.
    • Text Format and Editors: The restrictions on what content can contain (such as HTML tags) and which features the content editing tool provides to each user role (for example, you may not want someone who isn't an editor to be able to add links).
    • Maintenance Mode: The ability to set the site to prevent user login during maintenance activities.
    • Configuration Synchronization: The tool for importing or exporting the site configuration settings so that they can be transferred to or from another system.
    • Search Pages: For configuring site search, indexing settings, search logging, and adding site search pages
    • URL Aliases: For creating an alias for a specific page so that the default Drupal URL such as mysite.com/node/22 could be something more user friendly, such as mysite.com/using-drupal. I discuss an even better approach in Chapter 5Making Drupal Even More Useful.
    • RSS Publishing: Configuration settings to provide a content feed from your site. We'll look at creating a selective RSS content feed in Chapter 7, Feeding the Masses – RSS.
    • Basic Site Settings: Where the initial settings of site name, email address, and others can be changed.
    • Cron: Drupal performs certain tasks in the background, meaning not via the browser, at defined intervals throughout the day. The interval can be configured here and an ad hoc request to run cron can be made.
    • Shortcuts: As mentioned earlier, shortcuts allow you to place Drupal destinations on a task bar so that they can be reached with one click, and groups of them, such as those that apply to a singular purpose, can be managed here.
    • Filesystem: Assets such as images, PDFs, and media files are kept in the web server's filesystem, and here is where their location is managed.
    • Image Styles: Different configurations can be created that you can apply to uploaded images when the image is requested by the browser, depending on the context for their use, such as a cropped thumbnail for use in a list of items, or a full-sized version for use in a full page display of the content. An example of the use of an image style will be shown in Chapter 7Feeding the Masses – RSS.
    • Image Toolkit: If more than one system library for manipulating images (by the image style) is present, the selection of which to use can be made here.
    • Regional Settings: For changing the locale and timezone settings that were selected or left unchanged during the installation process.
    • Date and Time Formats: For setting the site default on how to display the date and time, an example of which is Monday, December 15, 2020 or Mon, 12/15/20.

As modules are added, the list of configuration pages shown in this section can grow:

  • People is where user accounts, user roles, and user permissions are maintained, created, or in the case only of users and roles, removed. We will cover this in Chapter 3, Managing Users.
  • Reports provide administrative reporting such as a site status report, as well as a report that shows the top search terms used on the site. Add-on modules can add further reports, as can Views, which we will use to add a report in Chapter 8, Welcome Home!
  • Help provides getting-started tips, additional information about add-on modules that have help text associated with them, and other information.

 

Tabs

Tabs are a way of providing contextual information on a page rather than needing to leave the page to change context. For example, the default homepage has the Home tab as the sole context, but a page such as the user page might have a User tab that contains the user settings such as username and password, and a Profile tab for managing profile information such as country, gender, and social links.

System message area

The system message area is where important notices appear. Remember that the location could be different in another theme, as could the formatting. Unchanged, the location will be above the main page content, and the format will be one of the following:

  • Green: General information worth noting
  • Yellow: Indicating a warning; worth noting but not critical, usually meaning that the system completed what it was requested to do, but not without incident
  • Pink: An error that should be acted upon or investigated, usually indicating that the system was unable to fulfil a request

These statuses are also used when a user completes a form, with the following as the typical presentation:

  • Green: A message indicating that the form was saved or submitted
  • Yellow: Inviting the user to review something in the content or to confirm its submission
  • Pink: Indicating that a required field is without a value or that the value is not correct in context

Search widget

A content site would be of little value without the ability of the user to search for content based on one or more specific search terms or a phrase. So, some form of search widget is common, with a field in which to enter the term(s) and a link or button with which to initiate the search.

 

 

User menu

There can be actions or destinations specific to a user role or even a specific user, and a user menu is a good place to provide links to them. User menus are not always present, as often sites limit the navigation to a specific set that is woven into the theme.

Main navigation

The default main navigation consists of a link to the user's account page, which is sometimes represented with a silhouette or user image, and a link to log off though. Customizations can provide additional choices, as well. The main navigation can be much more prominent, such as in the case of e-commerce sites, where actions are as important to the user as the content itself.

Main content area

The heart of the CMS site is, after all, the content, and most homepages and interior pages will have an area in which to display content, whether that be text, video, or some other form of media. Depending on the theme, there could be initial content above and/or below the main content, more than one piece of content within the main content area, and small areas of additional content, blocks, in other parts of the page, such as the Search and Tools menus in the preceding screenshot.

 

Summary


In this chapter, we have learned how to run the Drupal installation script, which creates a new Drupal website. We also looked at the major sections of the Drupal homepage and administrative navigation.

In the next chapter, we will look at how content is stored, and how you can configure the system to store various types of content in a way that is meaningful to you and your site visitors.

About the Author
  • J. Ayen Green

    J. Ayen Green is a software architect, developer, author, poet, and rascal. He is the author of titles including Drupal 7 Views Cookbook, Drupal 6 Content Administration, and Drupal 6 Attachment Views. Green enjoys nature, critters, photography, the arts, experiencing other cultures, riding horses, and discovering new ales. He and his wife, Sofia-Aileen, make their home in Atlanta when they're not traveling.

    Browse publications by this author
Latest Reviews (1 reviews total)
Great service and good book. Very helpful to start using Drupal 8. Will use Packt again.
Drupal 8 Quick Start Guide
Unlock this book and the full library FREE for 7 days
Start now