This week we're adding 10 more tutorials to our Drupal 8 Module Development Guide which dive into the Render API, an essential part of every module developer's toolkit. In fact, if you're writing custom code for Drupal and you want to display something on the screen you're going to have to use the Render API at some point.
If you've ever looked at the code in Drupal there's a good chance you've encountered the Render API -- even if you didn't know what you were looking at. It's an essential part of the process that Drupal uses to display content and create forms. Both module and theme developers are going to encounter and need to understand the Render API, at least at a high level.
Our suggestion: everyone writing code for Drupal, whether it's backend or front-end, should go through the first 2 tutorials in this list. Anyone needing to create or manipulate render arrays should keep going for more in-depth understanding of the Render API and how to use it.
Drupal 8 Render API tutorials:
- Render API Overview
- What Are Render Arrays?
- What Are Render Elements?
- Output Plain Text and Simple HTML Markup
- Output a List of Items
- Output a Table
- Use #prefix and #suffix Properties to Wrap an Element
- Output Content with a Template File
- Use Render Element Types in a Render Array
- Render Pipeline
In the coming weeks we'll be recording videos to go along with most of the tutorials listed above, as well as adding more Render API tutorials covering caching, creating custom render element types, and more examples of outputting common data structures as renderable arrays. Then, since the Render API is a fundamental part of the Drupal 8 Form API, astute readers probably already guessed that we're planning to cover that soon.
Do you want to know more about specific parts of the Render API? Let us know so we can add them to our pipeline.