Table of Contents
- Backup your database
- Check my code out of Github, or create a module directory
- Create a project info YAML file
- Create the necessary subdirectories
- Write the code to display your block
- Clear the caches
- Enable the module
- Place the block module
- See the custom block on your website
- The biggest problem I encountered
- The source code
In this tutorial I’ll demonstrate how to write a simple Drupal 8 “block module.” By this I mean that I’ll show you how to write a simple Drupal 8 module that will display output in a block. When you’re done you will have created a new block that you can place in one or more theme regions.
Quite often when I’m asked to review a UML “Use Case” that someone else has written, I ask “Have you tested your Use Case with real data?” Sadly, the answer is usually “no.”
I don’t know why people don’t do this, but they don’t, and it seems like a very logical thing — essentially a unit test for Use Cases.
We were playing at our camp when my older brother — who was standing on higher ground than I — saw something in the distance. He stood upright, then perfectly still. After a few moments he turned to me in a look of panic I had never seen before, pointed in a direction opposite from where he was looking, and screamed, “Run! Run!” I was startled at his behavior but I knew that something was very wrong, so I ran. And I ran.
I ran as fast as I could, weaving through the brush and constantly changing my course as I was chased by a white man on a dark horse. I thought I might be close to safety when I darted through some bushes, but I ran right into a creek that was too wide to jump across. As I paused for a moment to decide how to continue, the white man shot me in the back.
In intense pain and sudden shock, I stumbled forward into the creek, bent over with one hand in the creek. As I attempted to stand up and regain my balance, I was shot in the back again. This time my body flew forward towards the opposite side of the creek. I tried to control my fall but could not, and my torso slammed against the land. The right side of my face was pressed against the ground, my eyes still open. My right arm was trapped under my body, my left arm was somewhere down my left side. My legs lay in the creek’s water.
“Tell them I was a writer.” ~ Pieter Hintjens
“Mast cell disorders are neoplastic disorders, which means the mast cells multiply continuously over the patient’s lifetime. As with cancer cells, mast cells do not die, disappear, or cease to function, on their own.”
When I began reading the book, Never Bet Against Occam, I told my doctors that it was like reading my biography. At the very least it read like the biography of my last few years and hundreds of thousands of dollars in medical expenses, trying to find out why I kept getting very sick and passing out, and why my lab results were jumping around like a rabbit, first showing signs of one illness and then another.
I just noticed that another reviewer wrote, “The book was like a romance novel that I could not put down!” I won’t call it a romance novel, but I know that once I started reading it, I didn’t put it down either. I was smiling at the stories I related to, and also wondered, “Why don’t my doctors know about mastocytosis and mast cell activation disease?”
For more information, here’s a link to Never Bet Against Occam on Amazon.com.
Last night was a rough night, and it made me think of the Joe Walsh song, Help Me Thru The Night. This morning when I was looking for that song I came across a song called, Help Me Make It Through The Night.
This version is performed by Willie Nelson, but it was originally written and performed by Kris Kristofferson. If Willie Nelson isn’t your cup of tea, here’s a link to a Norah Jones version of Help Me Make It Through The Night.
“Some people aren’t meant to stay in your life. But that doesn't mean they can’t stay with you.”
Netflix has a good, short article on their “journey to asynchronous programming.”