drupal

recent posts related to the drupal content management system

Drupal 8: How to write a simple custom “block module” alvin June 21, 2016 - 8:25pm
Table of Contents1 - Goals2 - Backup your database3 - Check my code out of Github, or create a module directory4 - Create a project info YAML file5 - Create the necessary subdirectories6 - Write the code to display your block7 - Clear the caches8 - Enable the module9 - Place the block module10 - See the custom block on your website11 - The biggest problem I encountered12 - The source code13 - Summary

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.

How to configure Share Buttons by AddToAny with Drupal 8 alvin May 13, 2017 - 6:17pm

As a quick “note to self,” to get the Share Buttons module by AddToAny working in Drupal 8, I followed these steps:

- install the AddToAny module
- configure permissions so i could work with it
    - admin/people/permissions
- configure AddToAny as desired
    - admin/config/services/addtoany
- create a block, add it to a region (such as Content)
    - i actually created a block, then modified
      my theme to show AddToAny between the Contents and
      the Comments

The key to getting AddToAny was knowing to go to admin/structure/block and then selecting “Place Block” to create an AddToAny block. Not knowing that I had to do that slowed me down for quite a while.

Help, my Drupal 8 database is huge alvin July 17, 2016 - 1:28pm

Earlier today I ran into a problem making a Drupal 8 database backup. I ran the usual mysqldump backup command, and when it kept running for a long time I decided to kill it, and then began investigating the problem. I knew that I had recently deleted all of the log records, and the Drupal cron task was running correctly, so something else was going on. In short, I found that my Drupal 8 database was huge.

Drupal 8: How to add custom styles to the CKEditor “Styles” drop-down menu alvin June 25, 2016 - 1:12pm

A nice thing about the CKEditor in Drupal 8 is that it’s easy to add your own custom styles to the CKEditor “Styles” drop-down menu. This is the menu in the CKEditor widget you see when you’re editing content at a URI such as node/add/blog, which I’m referring to in this image:

The Drupal 8 CKEditor Styles menu

New version of this website alvin June 18, 2016 - 12:47pm

If you’re reading this, that means the DNS change for alvinalexander.com has propagated to your location. I just moved this website to a new server and the latest version of Drupal on June 18, 2016. If anything is wrong with it, well, that’s gonna be my fault. I’ll fix broken things as fast as I can. :)

Drupal Performance Optimization Checklist alvin June 16, 2016 - 1:48pm

Tips on performance optimization for Drupal websites.

In Drupal 8, anonymous page caching is enabled by default alvin June 16, 2016 - 1:46pm

“In Drupal 8, anonymous page caching is enabled by default. There is no option to turn it on or off.”

(Quote is from this pantheon.io article.)

Drupal - Jump for joy, or off the balcony Anonymous (not verified) June 6, 2016 - 5:08pm

Drupal alternatively makes me want to either jump for joy or jump off the balcony. Today was a balcony day.

Today’s issue is related to the handling of “tags” in Drupal 8, specifically the issue where you can’t add a new tag when editing a blog post, you can only reference existing tags. I have a degree in aerospace engineering, founded and sold a programming business, and can write software in many different languages, but a few things like this in Drupal make me feel like I need more of an education.

Drupal “Rewrite the output of this field” replacement patterns alvin May 23, 2016 - 7:56pm

As a quick note, if you’re looking at a Drupal form and it says you can use the "Rewrite the output of this field" replacement patterns shown (somewhere) on this page — and you can’t find those replacement patterns on that page — you can find a complete list of them at this drupal.org url.

As an example, if you’re working with a Drupal Node, you can use replacement patterns like these:

[node:author:name]
[node:content-type]
[node:content-type:name]