You’ve heard about it, read about it, and – if you’re like me – dreamed about it. Well, its time to stop dreaming and start doing.
If you have experience building sites using Drupal 7, you’ll be pleased to see that from a site building and administration perspective, things are nearly the same.
And if Drupal 8 is your first Drupal experience, you will be pleasantly surprised at how easy it is to build an amazing site.
First things first.
You’ll need a basic set of software installed and operational on your laptop, desktop, or server before proceeding with the Drupal 8 installation. Drupal requires that Apache, MySQL, and PHP are installed and working before beginning the installation process. There are several ways to easily install the required software using LAMP (Linux, Apache, MySQL and PHP), WAMP (Windows), or MAMP (Mac) solutions. Grab Google and do a quick search.
Good. Now there are five basic steps to install Drupal:
- Download the latest version of Drupal 8
- Extract the distribution in your Apache
- Create a database to hold the content from the site
- Create the files directory and settings.php
- Run the installation process by visiting your website in a browser
For details on the installation process visit http://wdog.it/4/1/docs.
These are the basic building blocks that will provide the foundation for your Drupal 8 site:
- Content types
If your site is simple and you’re the only one who will be authoring, editing, and managing content, then the admin account you created during the installation process may be all that you need. In situations where you want to share the content creation and management activities with others, you need to create accounts for those users.
To create a new user, log in – using the admin account you created – via the User login form on your site’s homepage. After logging in, you’ll see the admin menu at to the top of the page. Click on the Manage link, followed by the People link in the secondary menu which then appears.
One of the first tasks before creating a new user account is to define the user roles that you wish to have on your site. A user role represents a set of permissions to features and functionality on your site. You may have a single user role (e.g., author) or multiple roles.
The next step is to assign permissions to the role(s). To do so, click on the Permissions tab near the top of the page. On the Permissions page, you’ll see a list of all the permissions that are available to assign to user roles: Enable or remove permissions for each role.
With roles and permissions set, the next step is to create user accounts. Click on the List tab and then
click the Add user button on the User list page. Enter the values requested – including assigning the user to a role. If you checked the box to notify the user of their new account, an e-mail is generated and sent to them with instructions on how to access their account on your site.
One of the most misunderstood and underutilized capabilities in Drupal is taxonomy. Taxonomy, in simple terms, is the ability to categorize content by common terms or phrases. For example, if your site focuses on sports news, you could use taxonomy to identify content by football, basketball, soccer, baseball, tennis, golf, etc. With content tagged by term, you can grab all related content and easily display it.
You’ll find the ability to create vocabularies – and within vocabularies, taxonomy terms – by clicking the Manage link on the admin menu, followed by the Structure link on the secondary menu. Finally, click on the Taxonomy link. Create one or more vocabularies (categories) and assign one or more terms in each vocabulary.
Creating Content Types
Content types in Drupal represent templates that authors use to create and publish content. Think of them as a form that someone fills in with all the pieces of information you want to store and show for things such as events, blog postings, locations, courses and classes, movie reviews, or any other types of information where collecting exactly the same informational elements – in the same format and in the same order – is important.
Drupal 8 provides two basic content types: an article and a basic page. Both are great starting points for lots of different types of content. But sometimes we need more than just a title and body.
The interface for creating content types can be found under the Structure link. Click on the Content types link on the Structure page and you’ll see a list of existing content types as well as a link to create new ones.
Linking Content and Taxonomy
How do you connect taxonomy with content?
Add a new field to your content type and for field type select term reference. Click the Save button to continue the process. Follow the steps, ensuring that you pick the right vocabulary and the number of terms that can be selected for a content item.
With the basics of taxonomy and content types, you’re ready to venture off into the land of building an amazing Drupal site. But before you do there are a few other things I’d like to share that will make your life easier.
A site without a menu is like a car without a steering wheel. It’s best to provide visitors with the means for getting to where they want to go.
To create and manage the menus on your site, click on the Structure link, and on the Structure page click on the Menus link. The Menu page lists all the menus defined by default when installing Drupal 8. The Main navigation menu is typically set as the default primary navigational menu.
Adding items to a navigational menu is an easy task. From the Menus page, click on the Edit menu link in the Operations column and click the Add link button on the Edit menu page. You will be taken to the Add menu link page. From there, enter a title for the menu item (e.g., Google), and enter the URL for that link (e.g., https://www.google.com).
That’s all you need to do to create a new menu item!
Another power feature of Drupal is blocks.
A block provides a means to create a “widget” that displays something that can be placed on a page.
The search form and login form are both examples of blocks that come with Drupal 8. There are no hard-and-fast rules as to what a block can display; typically, it is information or images that are not related to content. However, you can display a list of content as a block.
To see the list of blocks that are part of a standard Drupal 8 installation, click on the Structure link. On the Structure page, click on the Block layout link. On the Block layout page, you will see a list of regions in the left column. Each theme defines a set of regions or areas on a page where you can place content, blocks, and menus. In the right column you’ll see a list of all the blocks that are defined by Drupal 8 core and that can be placed in any of the regions on your site. To assign a block to a region, just click on the block name; then, on the block configuration page select the region where you want the block to appear.
There are several ways to create blocks. A core, contributed, or custom module can create a block programmatically, or you can create a block through the Block layout page: Click on the Add custom block button and fill out the form, assign the block to a region, and you are on your way.
Expanding the Functionality of Your Drupal 8 Site
You’ve installed Drupal 8, created menus, content, content types, and taxonomy but you want more. Fortunately for you, there are thousands of very talented developers who have created thousands of modules that expand upon the functionality present in Drupal 8 core.
To find a contributed module, visit https://www.drupal.org/project/project_module; select 8.x from the Core compatibility select list and click search. You’ll see a list of all the modules that are supported on Drupal 8. Click on the title of any of the modules and you’ll see a detailed description of the module – and the installation instructions.
Changing the Look and Feel of Your Drupal 8 Site
The visual representation of your site is controlled through Drupal’s theming system. In Drupal 8 the “engine” that drives the theming capabilities is the Twig templating engine. Twig is new to Drupal 8 and it is awesome. [Editor’s note: flip to page 86 to learn more in Gettin’ Twiggy With It by Morten DK.]
You have several options when it comes to theming your site:
- Use a pre-built theme that has the look and feel you’re looking for. Remember to filter the list of themes by core compatibility, selecting 8.x, or
- Use one of the many starter themes, such as Zen. A starter theme provides the structure and, in many cases, a wealth of pre-built capabilities that makes it easy to spin up a new theme with minimal effort, or
All three approaches work great, it’s up to you what approach you’re comfortable with, and that achieves your goals. Installing a new theme can be as easy as clicking on the Appearance link in the admin menu, clicking on Add a new theme button, and following the directions for downloading a new theme to your site. After downloading, enable and set your new theme as the default theme, and there you have it; a whole new look and feel.
Managing Your Site
With a few clicks and a bit of configuration, you’ve created your new Drupal 8 site. Now you’re ready to “open the doors” and show the world what a terrific site you’ve built.
Of course, there are maintenance tasks you’ll need to perform to keep your site in tip-top shape. As your cheerful flight-attendant says: “In the unlikely event of a water landing...” That is, you need to be prepared for those unexpected bumps in the road by proactively administering your new site.
There are a number of common tasks you should put on your calendar, including:
- Backing up your site.. One of the easiest tools is the Backup and Migrate module.
- Reviewing the log files. While logged in as an administrator, click on the Manage link in the admin menu followed by the Reports link in the secondary menu. On the Reports menu, click on the Recent log messages link to see a list of errors and warnings that have been logged by your site.
- Checking for updates. On the Reports page, click on the Available updates link. If there are security fixes or updates to modules on Drupal.org they will be listed here.
- Check the status report. On the Reports page, click on the Status link. This is a real time peek into the current state of your site. If there are any configuration errors, they’ll show up on this page, as well as all the things that are correctly configured.
- Creating and disabling user accounts. Depending on whether you allow others to author and administer content, you may need to create new user accounts and disable accounts of people who are no longer associated with your site.
There are other maintenance tasks that you may wish to perform. For more information about maintaining your Drupal site, visit http://wdog.it/4/1/docs.
In a few basic steps you’ve taken a leap towards creating an awesome Drupal 8 site. Now you are only limited by time, your imagination, and your desire to learn. Drupal 8 is a fantastic platform for developing a wide range of sites, from simple to extremely complex.
Congratulations on taking the first few steps towards creating something amazing.
Remember to give back to the Drupal community by sharing your discoveries and creations!