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

Pathauto

There are many ways to install modules, and all require some administrative capability. The installation of the contributed module is outside the scope of this book. We'll start from the point of the module files being in the correct place.

Because the pathauto module is included with Drupal, the files certainly will be present. We can verify this by navigating to Extend on the admin menu, or /admin/modulesOnce there, enter pathauto in the filter text box at the top of the page. You should see the following entry listed:

Let's check the box beside it and click the Install button. Depending on what other modules have been enabled on your site, you might receive the following message:

If you do receive this message, or a similar one when you are installing a module, it is because the module is dependent on other modules, and one or more of them isn't enabled. If the necessary modules are present, Drupal will offer to enable them as well. Simply click Continue. In this case, if all goes well, you will receive a status message at the top of the reloaded page stating that three modules have been enabled: pathauto, Chaos tools, and Token.

At this point, we can configure Pathauto. Most modules have a configuration page, but not all. Scroll down to the Pathauto entry, or use the filter text box to find it, and click the arrow just to the left of the module description. An accordion control will open and reveal a configuration link, among other things. Click it, and you will be redirected to Pathauto's configuration page at /admin/config/search/path/patterns. The page will be sparse, because no pattern exists yet. Let's create one.

Click the +Add Pathauto pattern button. The resulting page, with the same title as the button that you just clicked, contains a dropdown selection that offers various entity types that are suitable for path patterns. Initially, the option are Content, Taxonomy, Term, and User. For any of those, a path pattern can be specified for creating meaningful URLs. We are going to create a pattern for Content, and select the same.

Our selection causes the page to change a bit, as each content type is now listed. You can check the box for Article, as we are creating a pattern for it.

We need to define the pattern that we want to use. There are many possibilities. We will choose a simple pattern. We'll have article URLs containing the word "content" and the article title in the form content/my-article-title. How will we get the article title to be used too? Click the link to Browse available tokens

Tokens are placeholders that will make a specific type of value available at the proper time. A pop-up will appear that contains a number of token categories. We are interested in Nodes, so click the arrow beside it. An expanded list will appear, and in it you will find Title, referring to the title of the node, or in this case, the article title. To the right of that is a link containing the token for the node title, [node:title]. Click inside the pattern text box, and then click the link for the token. It will appear in the text box. Now, place your cursor to the left of the token and type content/.

Lastly, type articles in the Label text box to identify this pattern. The form should look similar to the following screenshot, though your content type list might vary:

Click Save to save your pattern, and you will be returned to the pattern list, which will now have one entry. Let's test it by creating an article. Navigate to /node/add/article.

Add whatever title and body text you'd like. I'm naming my article My New Article. The magic comes when you save it. When I do, instead of having a URL like http://d8quickstart/node/5, I have http://d8quickstart/content/my-new-article. Note that the original URL will still exist and can still be used. The Pathauto list at /admin/config/search/path lists both the alias based on the pattern and the original URL for each node. In my case, the node I created has a node ID of 2, and so I could still enter http://d8quickstart/node/2 as the URL if I so desired. 

Notice that Pathauto automatically converted the article title to a URL-friendly string by replacing spaces with hyphens and making the title lower case. The settings for this can be controlled under the Settings tab on the Pathauto config page. There is an addition tab there that is very important: Bulk generate. Let's say that you create a pattern after a number of nodes have already been created. Rather than editing each and changing the URL to match your pattern, you can instruct Drupal to generate a patterned URL for every existing article.