Drupal 8 Blueprints
eBook - ePub

Drupal 8 Blueprints

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

Drupal 8 Blueprints

Book details
Book preview
Table of contents
Citations

About This Book

A project-based guide that will show you how to create 7 professional Drupal sitesAbout This Book• Create and design your own customized website effortlessly and efficiently• This up-to-date guide on Drupal 8 will show you how you can leverage the latest Drupal 8 features• This hands-on guide will turn you into a professional grade Drupal 8 developer through 7 unique and engaging web sitesWho This Book Is ForThis book is ideal for web developers who are looking to create professional web applications using Drupal 8. You should have some previous experience with Drupal and must have a basic knowledge of web application development in general. If you are looking to create fluent professional websites that will take you to the next level, then this book is for you.What You Will Learn• Find out how to use the Drupal 8 core functionality to build great websites• Discover how to better manage content using custom blocks and views• Display content in multiple ways, taking advantage of display modes• Using the new TWIG theme engine for Drupal• Easily manage and filter content• Understanding best practices for building great Drupal sites• Move beyond Drupal to build headless websites using RESTful services and JavaScript frameworksIn DetailDrupal is an open source content management framework that can be used for developing websites and simplifying online management of content for users.This book is a must-have for web developers who are looking to create professional-grade websites using Drupal 8. While building 7 different Drupal websites, we will focus on implementing the out of the box features that come with Drupal 8 and see how we can make some complex sites with minimal custom code.Focusing completely on Drupal 8, this book will help you leverage the new Drupal 8 features such as creating a different types and layouts of content using configuration to build in core with its built-in web services facilities, and effortless authoring using the new CKEditor with an effortless and efficient industry standard approach.The book starts with getting started with the development environment of Drupal. Each chapter will start with a brief overview of the site to be built and the required features. Then, we will proceed to create customized modules and themes and integrate third-party plugins. Lastly, you will learn about "headless" Drupal that uses RESTful services that would help you to display content outside of DrupalBy the end of the book, you will be able to implement the knowledge gained to build your own custom websites using Drupal 8.Style and approachThis unique, project-based resource on Drupal 8 website development will show you how to leverage Drupal 8's features to create customized, professional-grade applications efficiently and effectively.

Frequently asked questions

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.
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.
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.
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.
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.
Yes, you can access Drupal 8 Blueprints by Alex Burrows in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781785887901
Edition
1

Telling Your Own Story with Drupal

Latest news is an important part of any website for many businesses. They allow the business to engage with their customers and keep their employees updated. In this chapter, we will create a simple news website using Drupal 8 core functionality. This can also be used as a blog; we're just making it sound exciting and relatable.
This chapter will be a little more in depth in showing how the basic functionality of Drupal works; this will allow quicker development later throughout the book.
We will explore the following topics in the chapter:
  • Creating a new content type
  • Creating taxonomy terms and associating them to news posts
  • Using custom views to display the listing and individual news pages
  • Enabling a comment field to allow user comments
  • Referencing other news articles on the site
  • Setting up restricted articles
  • Understanding permissions and roles
  • Configuring the editor experience
We will learn how to create a content type and implement the fields required for displaying the news articles; this is more of a refresher on how to do things. We won't go into this much detail on beginner items again. If in doubt, take a relook at this chapter.
We will also create custom view modes for displaying different display types using references from the post, and then finally, move into the theme layer inside twig templates for displaying the content.

Creating the Post content type

In Drupal, we use the terminology of entity, and we have bundles inside an entity. As part of the Drupal core functionality, we have content types, which is in fact an entity type and therefore the Post content type is a bundle.
So, now that we are familiar with some basic Drupal terminology, let's move on to creating our Post content type.
If you use the menu at the top and click on Manage | Structure | Content Types, you will be taken to the Admin page for Content types:
Fig 1.1: The content type management page
By default, we have two content types in a standard Drupal installation (Basic page and Article). Article is pretty much a Post content type; however, for this, we shall ignore this and create our own content type entirely from scratch.
To create a new content type, click on + Add content type:
Fig 1.2: The Add content type page
On this page, we are presented with some fields, which we use to set up how a content type works.
So, let's add the information for these fields:
  • Name: Post
  • Description: Create a new post to display
  • Menu settings: Uncheck all available menus
Click on Save and manage fields, and we have now started our Post content type.
The content type is split into four tabs:
  • Edit: This allows for the settings we just added to be modified; however, you cannot change the machine name once the content type is created.
  • Manage fields: This allows us to add/edit/remove fields from the content type. In the previous versions of Drupal, you could move the fields up and down to order how they appear on the form. This is no longer the case and appears under the Manage form display tab.
  • Manage form display: This allows for the fields to be reordered and the formats to be amended for this page. This won't affect the Manage display tab. It will only be visible to any user who has permission to add, edit, or delete.
  • Manage display: This allows the fields to be reordered for how they will appear on the display. It will affect the output of how the fields are displayed on the page.

Creating our fields

Now that we have our Post content type created, we need to add the fields we want to use:
Fig 1.3: Adding fields to content type
In Fig 1.3, we can see the layout for adding fields to our content type; we can see that there is already a field called Body, which is created by default; the field UI is split into four columns:
  • LABEL: This is our user-friendly label; when we enter our label, this generates the machine name.
  • MACHINE NAME: This is the unique name for the field; fields can be reused throughout Drupal, but only one per content type. If we create a field called subtitle, it will generate the machine name as field_subtitle; we can, however, override this to name it how we want.
  • FIELD TYPE: There are various types of fields (text, list, autocomplete, and so on), which are created by plugins, but for now these are the ones we have in Drupal core.
  • OPERATIONS: These are the features of the field.
  • Edit: This allows us to edit the basic settings for the field, including label, help text, default value, and any other configuration that is required for the field.
  • Storage settings (Field settings): This allows us to set the number of fields we require for this field.
Now that we have a basic understanding of the field system, let's move ahead and create our fields. We do, however, need to categorize the posts after we have created our basic fields so that we get an understanding of what happens; we will then add the categories known in Drupal as taxonomy.

Adding our fields

For our Post to show content, we need to add some fields so that the user can input content. For this, we will have...

Table of contents

  1. Title Page
  2. Copyright
  3. Credits
  4. About the Author
  5. About the Reviewer
  6. www.Packtpub.com
  7. Customer Feedback
  8. Preface
  9. Introduction and Getting Set Up
  10. Telling Your Own Story with Drupal
  11. Get Fundraising with Drupal
  12. Recruit Using Drupal
  13. List Properties with Drupal
  14. Express Your Event with Drupal
  15. Get Teaching with Drupal
  16. Go Static with Drupal