Table of Contents for
Drupal 8 Quick Start Guide

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Drupal 8 Quick Start Guide by J. Ayen Green Published by Packt Publishing, 2018
  1. Drupal 8 Quick Start Guide
  2. Title Page
  3. Copyright and Credits
  4. Drupal 8 Quick Start Guide
  5. Dedication
  6. Packt Upsell
  7. Why subscribe?
  8. Packt.com
  9. Contributors
  10. About the author
  11. About the reviewers
  12. Packt is searching for authors like you
  13. Table of Contents
  14. Preface
  15. Who this book is for
  16. What this book covers
  17. To get the most out of this book
  18. Download the color images
  19. Conventions used
  20. Get in touch
  21. Reviews
  22. Finding Your Way around Drupal
  23. Installing Drupal
  24. Readying the environment
  25. Running the Drupal installation script
  26. Site information
  27. Site maintenance account
  28. Regional settings
  29. Update notifications
  30. The behind-the-scenes tour
  31. Administration menu
  32. Tabs
  33. System message area
  34. Search widget
  35. User menu
  36. Main navigation
  37. Main content area
  38. Summary
  39. Structuring Content Types
  40. What is content?
  41. Content as fields
  42. Understanding content types
  43. Defining the content type
  44. Submission form settings
  45. Publishing options
  46. Display settings
  47. Menu settings
  48. Managing content type fields
  49. Designing a content type
  50. Content type settings
  51. Fielding the content type
  52. Field types
  53. Our content type field
  54. Adding fields to the content type
  55. Summary
  56. Managing Users
  57. User types
  58. User roles
  59. Managing permissions
  60. Users
  61. Creating a user account
  62. Summary
  63. Creating and Editing Content
  64. Using the WYSIWYG editor
  65. Title*
  66. Body
  67. Summary Field
  68. Body text
  69. Text format
  70. Tags
  71. Images
  72. Publishing the content
  73. Additional settings
  74. Revision log message
  75. Menu Settings
  76. Comment Settings
  77. URL Path Settings
  78. Authoring Information
  79. Promotion Options
  80. Completing the process
  81. Summary
  82. Making Drupal Even More Useful
  83. Pathauto
  84. Paragraphs
  85. Content moderation
  86. States
  87. Transitions
  88. Workflow application
  89. Summary
  90. Grabbing Global Readership
  91. Declaring additional languages
  92. Translating content
  93. User language selection
  94. Translating the user interface
  95. Summary
  96. Feeding the Masses – RSS
  97. Why feeds?
  98. Selecting content for a feed
  99. Modifying content for feed selection
  100. Pick-me flags
  101. Tags
  102. Views
  103. Creating the container view
  104. Creating the Pets feed
  105. Display name
  106. Title
  107. Format
  108. Feed settings
  109. Filtering the criteria
  110. Sort criteria
  111. Creating the Travel feed
  112. Title
  113. Feed settings
  114. Format
  115. Filtering criteria
  116. Creating the Leftovers feed
  117. Title
  118. Feed settings
  119. Format
  120. Filtering criteria
  121. Creating the Feed Links block
  122. Summary
  123. Welcome Home!
  124. BAD home page!
  125. Design improvements
  126. Too much content!
  127. No access to content
  128. No RSS feeds menu
  129. We need a Terms and Conditions page
  130. Making the changes
  131. Improving the Frontpage view
  132. Title
  133. Format
  134. Fields
  135. Filtering criteria
  136. Block settings
  137. Pager
  138. Adding an Archive
  139. Adding the RSS Feeds menu
  140. Fixing the Footer menu
  141. Summary
  142. Other Books You May Enjoy
  143. Leave a review - let other readers know what you think

User roles

To Drupal, a role has the same meaning as it does outside of Drupal: the functional aspect of the user, sometimes considered a persona. It's worth mentioning that Drupal does blur the line a bit between a role and a user type, because it comes with three roles predefined, and they are the user types mentioned earlier. While administrator makes sense as a role, authenticated and anonymous are not really roles, but appear there to simplify things, for administrators, at least.

So, let's take a look at the default user roles inside of Drupal before we move on to discussing why you would want additional ones. If you are using the menus, click People in the Admin menu (admin/people), and then click the tab labeled Roles, as in the following:

The preceding screenshot shows the roles that are predefined in Drupal. I disagree with the given description of a role, because it is unclear. The order of operation in Drupal is that privileges are assigned to roles, and roles are assigned to users. We'll discuss that more when we add a user and when we assign some permissions, later in this chapter.

For now, let's focus on the default Drupal roles themselves. As I mentioned earlier, anonymous and authenticated are actually more user types than roles, but in Drupal they are referred to as roles. When would these three roles, alone, be sufficient? One example would be a site where all users with logins can create content, and all users that have no login can only view that content. If those are the limits to your organizational and site complexity, you can jump ahead to the section on User Creation if you'd like.

Let us consider. The anonymous role stands on its own. Why? Because it is defined as a user with no account or login, which is to say, a user that is not identified. We would not assign the role of Anonymous to a user account, because if there is an account, the user of it is no longer anonymous. There would be no sense in creating different roles for anonymous users, because there would be no user accounts to assign those roles. So, that leaves us with the other two roles, and we can use those to derive examples.

On our site, we will have four types of non-administrative authenticated users. The first will be authenticated users in general. That is, users with this role will be able to login, and in addition to being able to see the Article and Page site content that Anonymous and all users can see, they will be able to see content of the Appointment type we defined, as well.

This could be our use of the Authenticated role, since all users logging in will have those capabilities at a minimum, but we won't use that role for it. Why? Because we have to account for the possibility that later there might be the need to have some users who can log in but cannot access appointment data. In general, I prefer to leave the predefined roles  unchanged for that reason...use them as a model instead, or as is. So, we will call the new role Client.

One thing to keep in mind when creating new roles for a logged-in user is that because the user is logged in, and thus also an authenticated user, the user will receive all the permissions assigned to the Authenticated role, too. 

There will be three additional roles for authenticated users on our site:  Client, who is able to view appointments; Consultant, who is able to create and edit appointments; and Editor, who is able to create and edit content other than appointments. The complete list of our user roles and their use are given in this table:

Role

Use

Anonymous

Unknown users. Able to read Article and Page content.

Authenticated

Users with accounts. Able to comment on Article content.

Client

Authenticated + able to view Appointment content

Consultant

Authenticated + able to perform Appointment CRUD*

Editor

Authenticated + able to perform Article and Page CRUD*

Administrator

Authenticated + able to access Drupal admin functions and manage user accounts

* CRUD = Create/Read/Update/Delete 

Follow these steps to add the Client role:

  1. Click the +Add role button, which leads to the page admin/people/roles/add
  2. Enter the role name, Client 
  3. Click Save

Notice that the role list now includes Client. Follow the steps above for the Consultant and Editor roles as well. The role list should now appear as shown in the following screenshot:

All roles are now available for use. However, their capabilities have not yet been defined. Since we've covered all that we need to regarding the creation of roles, let's move on to the topic of permissions.