O'Reilly logo

Drupal 8 for Absolute Beginners by James Barnett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 11

image

Creating a Drupal Block Programmatically and Basic MySQL Usage

This chapter shows how you can have a Drupal module do more than one thing—in this case the hello_world module creates a custom page and you will now create a custom block. Rather than create a brand-new module to create the custom block, you’ll just add code to the existing module. This chapter also explores how to construct basic queries to pull information out of Drupal’s back-end datastore, which for most Drupal installations will be a MySQL database (although hooking up other database types to Drupal is possible).

 Note  The code for this Drupal module is on Github: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required