This week we continue to explore what's new in Drupal 8. We began this series with the Theming, CMI, and OO-PHP editions of our What's New in Drupal 8 series. Last week, we covered what's new in the Entity API, Blocks, Content Authoring Experience, and Mobile and Responsive Features. This week, we have videos outlining what's new in extending Drupal 8 (where did all the hooks go?), new site building features and workflows, and multilingual features. Finally, as a bonus, we have a free video tour of localize.drupal.org, where you can see how Drupal gets translated into languages from all over the world.
March 2017 Tutorial Updates
Blog postMarch was a busy month for us as we continue to work on producing the best Drupal 8 tutorials. We released new tutorials for developers of modules and themes alike.
Meet Drupal Site Builder Danita Bowman
Blog postDanita has been on Drupal.org and working with Drupal full-time for 4 years. In this interview she answers some questions for us about being a site builder. Meet Danita!
Like many things in Drupal, there are multiple ways to solve the same problem when using Layout Builder. The Layout Builder system is very flexible. In order to be successful when using it, it helps to plan ahead and think through your specific use-case. Picking a pattern, and sticking to it, will help ensure your configuration is more maintainable, and easier for others to understand. While there's nothing to prevent you from mixing and matching, in our experience we've found it's helpful to at least set some ground rules.
In this tutorial we'll outline 3 different patterns to use with Layout Builder, and the pros and cons of each. We'll include:
- Using content fields in scenarios where a few pages use Layout Builder, but the majority of the site's layout is done via the theme and is generally not configurable by editors.
- Using a blocks-based approach to layouts for scenarios where you want to use Layout Builder instead of the traditional blocks and regions approach and allow editors to make changes via the UI.
- And finally, using an Entity view modes approach for sites that rely heavily on Layout Builder and contain lots of interrelated content types with complex layout requirements.
By the end of this tutorial you should have a better understanding of how to approach using Layout Builder for your specific use-case, and the advantages and disadvantages of different common patterns.
Release Day: JavaScript in Drupal 8
Blog postWe're happy to announce the addition of several JavaScript-related tutorials to our Drupal 8 Theming guide. These tutorials, along with our other tutorials on defining defining and attaching asset libraries will help you understand Drupal's JavaScript API and help you make sure your custom code follows the established best practices.
Layout Builder, and the related ecosystem of modules, provides a set of powerful tools that allow content creators and site administrators to modify the layout of a page using a drag-and-drop interface. We've published 11 new tutorials on how to use Drupal's Layout Builder to create flexible layouts for your Drupal site.
Template files in Drupal modules provide the default HTML markup for the visual presentation of a module's data. Be aware that themes are likely to override the template with site-specific customizations. This template should contain only minimal markup to ensure functionality, and document the variables fed into the template.
In this tutorial, we'll:
- Explain the role of Twig template files in modules.
- Show how modules declare and use template files.
- Recognize how a render array can specify a template.
By the end of this tutorial, you should be able to articulate how and when a module should define a new template file.
Release Day: More Twig Tutorials
Blog postThis week, Leanna Pelham of KnpUniversity continues to show you how to become a Twig expert by demonstrating Twig goodies such as template inheritance, functions, tests, for and if syntax, debugging techniques, macros, and other advanced tips and tricks. Each lesson is a bite sized tutorial and includes downloadable site code that will get you up and running with Twig without getting overwhelmed.
Drupal 8.0.0 Released
Blog postIt's finally here! Drupal 8.0.0 was just released, and our team is busy producing new tutorials.
This week we have a ton of new tutorials for you to enjoy. We're very happy to bring back our friends from KnpUniversity to provide a great little series on the Twig templating system, and we're also wrapping up the entire O'Reilly Using Drupal book series with the final tutorials.
We're super excited to release a new series this week, which has been a highly requested one on our suggestion list: PSD to Drupal Theme. This series walks you through the process of converting a static design into a Drupal theme. We'll be covering strategies for breaking down your design into Drupal pieces, extracting your design assets, and working with those components in your CSS. Along the way you're going to also be introduced to grid frameworks, Sass, and other very helpful general web development tools. At the end you will have a theme that you can install and enable on your Drupal site. Having a little bit of Drupal site building experience, and a little bit of Web experience (HTML and CSS) will be helpful but it's not required, so if you find the world of Drupal themes mysterious, this is a great series to clear the fog.
14.3. Learning More
FreeHow to find additional material to gain advanced site-building skills.
Let's Debug Twig in Drupal 8!
Blog postWhen I am theming a Drupal site, I need to know which variables are available on a template file. In Drupal 8, the template engine is Twig, so we’re going to need to know a little bit of Twig to make this work. So, if Twig is totally new to you, don’t worry. Today, you’ll learn some Twig!
Drupal 8 Is 1 Year Old
Blog postIt’s hard to believe, but it has been 1 year since Drupal 8.0 was released to the world. We’re celebrating Drupal 8’s first birthday on November 19th by giving FREE access to our full Drupal 8 Migration Guide over the celebration weekend! This Saturday, November 19th through Monday, November 21st you can learn how to use the new core migration system to upgrade your Drupal site or import content from external sources. It’s time to get using Drupal 8!
Just two weeks ago we launched our new format for guides, along with a landing page that presents our guides and topics on one page. This week we’re pleased to add 2 more new guides to the list: Introduction to Drupal and Learn Drupal 8. Both of these guides provide overviews that answer common questions and point you in the right direction to get started with Drupal.
Drupal Events and Membership Giveaways
Blog postWe're thankful to the volunteers around the world who support the community by running camps. We've partnered up with several of them as sponsors and to give away free Drupalize.Me memberships. Get yourself to one of these events and you can win a free month of Drupalize.Me! Here is a list of upcoming events where you can win a free membership in the next 2 months.
We've updated our Configuration Management series with new tutorials on deployment workflows as well as updated tutorials on managing and inspecting configuration with Drush (now with Drush 9 commands). We've also done some re-arranging and moved our tutorials about using Drupal's Configuration API in a module to a new series, Configuration Entities. Finally, we've added a new tutorial on setting up and using Drush Site Aliases, since this is a prerequisite for completing the new tutorial Live vs. Local Configuration Management. Happy configuration managing!
Drupal 8 Survey Insights
Blog postLast month we asked the Drupal community a few questions. We received 243 responses to our survey, and we'd like to share some of the information. While we're not making scientific generalizations from this data, it is an interesting picture of our community nonetheless. A big thank you to everyone who participated in the survey.
Here are 4 things we learned:
In this exercise, we'll continue our template overriding practice by overriding the image field template. We'll consult the Bootstrap documentation and add a responsive image class that will apply to any images uploaded by a user to the field_image field. Once again, we'll add this class to the classes array in the set Twig tag. You should work on the exercise steps below first, and you can refer to the video if you need some help.
Drupal media entities are fieldable entities, which means that you can add any custom fields you want to your Media types. These fields can be used for collecting additional metadata about a resource, categorizing and organizing resources so they're easier to find in a large media library, or for displaying information like a photo credit or transcript for a video. The possibilities are endless once you know how to add, and optionally display, fields in Drupal.
Some example use cases for adding fields to Media types:
- Collect, and display, a credit to go along with a photo. This could also be a date, a location, or any other metadata.
- Store resource width and height dimensions as custom fields so they can be referenced by display logic in the theme layer.
- Use Taxonomy reference fields to add tags or categories to help keep a large library organized.
In this tutorial we'll:
- Learn how to add fields to a Media type
- Verify our new custom field is working
By the end of this tutorial you'll know how to add custom fields to any Media type.