Summary
In this chapter, we explored how Drupal builds a page in every aspect. Starting from how to define a template and moving all the way to how to use it to render a section of a page, we’ve built our first controller action.
We then saw how controllers and blocks are used to populate the regions of a theme.
You then learned how to attach CSS and JavaScript files to a template by defining and using a library.
Finally, we also discovered how to render the output of a controller action in a dialog by loading its content with an AJAX call and without writing a single line of JavaScript.
Now that you know how the internals work and the Drupal render pipeline doesn't hold any secrets, we can start styling the demo website. In Chapter 4, Mapping the Design to Drupal Components, we'll analyze materials provided by the design team to see how it fits in our Drupal site.