You are previewing Drupal 8 for Absolute Beginners.
O'Reilly logo
Drupal 8 for Absolute Beginners

Book Description

Drupal 8 for Absolute Beginners is your definitive guide to starting from scratch with Drupal even if you have little web knowledge. This book teaches you the basics of HTML, CSS, JavaScript, and PHP in relation to Drupal, so that you can begin to use this popular CMS with all of its features.

You will first learn how to set up and customize a basic blog using Drupal, one of the most powerful and popular content management systems available today. From there you will learn the basics of HTML, CSS, JavaScript and PHP, and apply this knowledge to create your own custom Drupal module. You will learn how to build, style, and add functionality to your own Drupal module from scratch. You will then use Drush to apply a theme to Drupal, customizing everything to your liking, before publishing your work to the world. The book also covers some more advanced topics that beginners often ask about, such as getting set up with Git and using source control, using MySQL to interact with a database, and a guide to getting up and running with Linux.

Rarely has all the knowledge required to start with Drupal been collated in one place as it is in Drupal 8 for Absolute Beginners. You need no prior knowledge of the web, only a desire to learn. The book is fully supported by video material on the author's website. Start your Drupal journey with this book today!

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Author
  8. About the Technical Reviewer
  9. Acknowledgments
  10. Introduction
  11. Chapter 1: Installing Drupal
    1. Installing Acquia Dev Desktop
    2. Installing Drupal 8
    3. Configuring Drupal 8
    4. Summary
  12. Chapter 2: Site Building: Building Drupal Sites Without Programming
    1. Setting a New Site Title and Logo
    2. Adding More Users to Your New Drupal site
    3. Assigning Roles and Permissions to Site Users
    4. Creating a Blog
      1. Editing and Customizing Your Blog Post
      2. Adding More Fields to Your Blog Node
    5. Working with Blocks
    6. Working with Views
    7. Changing Your Site’s Theme
      1. Installing a Theme Using Drush (Preferred Method)
      2. Installing a Theme from a URL
    8. Installing New Add-on Modules
      1. Installing a Module Using Drush (Preferred Method)
      2. Installing a Module from a URL
    9. Summary
  13. Chapter 3: Getting Started with HTML
    1. Creating Your First Web Page
    2. Adding Comments to Your HTML
    3. Working with Images
    4. Creating Lists
    5. Creating Tables
    6. Adding Anchors
    7. Creating Forms
      1. Text Fields
      2. Password Fields
      3. Radio Buttons
      4. Drop-downs
      5. Text Areas
      6. “Submit” Buttons
      7. All Together Now
    8. Using Layout Elements
    9. Summary
  14. Chapter 4: Creating a Basic Drupal Module with HTML Output
    1. Working with the Drupal Docroot Directory
    2. Creating a Basic Drupal Module
    3. Looking at the Model, View, Controller Design Pattern
    4. Showcasing Different HTML Elements Within the Drupal Module
    5. Renaming a Module—and How to Create a Module Not Named “hello_world”
    6. Summary
  15. Chapter 5: A CSS Primer for Drupal
    1. A Quick Look Back at the Limits of HTML
    2. Styling Your Text with an External Style Sheet
    3. Using <div> and <span> Tags
    4. Commenting Your CSS
    5. Creating Additional Styles
    6. Choosing Between Classes and IDs
    7. Working with Conflicting Styles
    8. Using Internal Style Sheets
    9. Using Inline Styles
    10. Understanding the Cascade Order
    11. Working with Commonly Used CSS Styles
      1. Text Styles
      2. Fonts and Font Sizes
      3. Links
      4. Tables
    12. Working with the CSS Box Model
    13. Summary
  16. Chapter 6: Adding CSS to Your Drupal Module
    1. Using CSS Within Your
    2. Summary
  17. Chapter 7: A JavaScript Primer for Drupal
    1. Getting Started with JavaScript
    2. Adding Basic JavaScript to a Web Page
    3. Installing Firebug
    4. Using Firebug
    5. Modifying JavaScript Code
    6. Working with JavaScript Programming Constructs
      1. Variables
      2. Arrays
      3. Objects
      4. Booleans
    7. Creating JavaScript Events
    8. Using the jQuery Library
    9. Using the jQuery Library with Events
    10. Summary
  18. Chapter 8: Adding JavaScript to Your Drupal Module
    1. Adding JavaScript to Your Drupal Module
    2. Summary
  19. Chapter 9: A PHP Primer for Drupal
    1. Verifying Your Installation of PHP
    2. Serving Up a Hello World Web Page with PHP
    3. Working with Some Basic PHP Code
    4. Working with PHP Looping Structures
      1. Using the foreach Loop
      2. Using the while Loop
    5. Printing to the Screen
    6. Using If, If Else, and Else If Statements
    7. Switch Statements
    8. Working with Strings
      1. strlen
      2. strpos and stripos
    9. Using Functions
    10. Functions Operating on Arrays
    11. Summary
  20. Chapter 10: Adding PHP-Generated Output to Your Drupal Module
    1. Adding Custom PHP to the hello_world.module File
    2. Summary
  21. Chapter 11: Creating a Drupal Block Programmatically and Basic MySQL Usage
    1. Creating Your First Block Programmatically
    2. Learning about the Drupal Database and Using a MySQL Query in a Custom Block
    3. Using a Query to Display Data in a Custom Programmatically Created Block
    4. MySQL Primer
      1. Wildcard Character in Queries
    5. Summary
  22. Chapter 12: Theming Your Site Part 1: Theme Functions and a Twig Primer
    1. Theming Output from a Module
      1. Using a Theme Function
    2. In Depth with Twig: A Twig Primer
      1. Twig Variables
    3. Summary
  23. Chapter 13: Theming Your Site Part 2: Creating a Custom Theme and Subtheme
    1. Creating a Subtheme
    2. Creating a New Base Theme
    3. Overriding Existing Theme Functions
    4. Exploring Other Options for Overriding Theme Functions
    5. Summary
  24. Chapter 14: Working with Forms and Creating Custom Forms
    1. Using the Form API
    2. Creating a Node Programmatically Using a Custom Form
    3. Showing a Custom Form in a Block
    4. Summary
  25. Chapter 15: Using Git to Manage Your Source Code
    1. Introducing Git
    2. Installing Git
      1. Installing Git on a Mac
      2. Installing Git for Windows
      3. Installing Git with Linux
    3. Creating an Account on Github and Downloading the Book’s Code
    4. Using Git to Contribute to a Project
      1. Creating a Github Repository
      2. Navigating Your Github Repository
    5. More Great Git Commands
    6. Checking Differences Between Branches and HEAD
    7. Using a GUI for Git
    8. Summary
  26. Chapter 16: Advanced MySQL Primer
    1. Creating a New Database
      1. Using phpMyAdmin to Create a Database
      2. Using the Command Line to Create a Database
    2. Creating Tables
      1. Using phpMyAdmin to Create a Table
      2. Using the Command Line to Create a Table
    3. Inserting Data into a Table
    4. Updating Tables
    5. Deleting Data
    6. Creating and Editing Tables in Drupal
      1. Creating the Table in the Drupal Module
      2. Inserting Data in a Drupal Table
    7. Updating and Deleting in Drupal
    8. Summary
  27. Chapter 17: Linux
    1. Introduction to Linux on a Mac
    2. Connecting to Ubuntu
      1. Connecting to Ubuntu from a Mac
    3. Getting to Know Some Common Linux Commands
      1. Navigating Among Directories and Managing Files
      2. Installing LAMP
      3. Adding Security with Permissions
      4. Searching for Specific Files
    4. Creating Shell Scripts
    5. Editing Files on a Linux Box
      1. Editing Files with Komodo Edit
    6. Summary
  28. Chapter 18: Publishing Your Site to a Production Linux Box
    1. Setting Up the Linux Box in the Cloud
      1. Connecting to a New Linux Box Via SSH
      2. Setting Up the LAMP Stack on an Ubuntu Linux Box
      3. Installing git for Version Controlling Your Code Base
      4. Installing Drush
    2. Putting Up Your First Web Pages
    3. Installing Drupal
    4. Getting a URL for Your New Drupal Site
    5. Summary
  29. Appendix A: Other Ways to Install Drupal
    1. Installing Drupal with MAMP on a Mac
    2. Installing Drupal with XAMPP on a Windows Machine
    3. Summary
  30. Appendix B: Basic Linux Commands
  31. Index