Jun 26, 2022

New! Drupal Testing Strategies

Creating a Drupal site can be a complex process. Some people put together Drupal sites using a collection of different modules whilst others use Drupal as a framework and build the site using code.No matter what sort of Drupal site you have, you'll need to have some testing in place to make sure that it works correctly. This is especially important when applying updates to your sites as the updated code can create unwanted side effects (or contain bugs) that might cause the site to... more

Jun 19, 2022

New! Drupal 9: Removing Base64 Encoded Files From Content

Occasionally, I have come across Drupal sites that have base64 encoded images embedded into content fields. This is the approach of taking the binary data contained in a file and converting it into a string of characters. The original binary data can then be re-created using this string and the data is understood by lots of different technologies (including web browsers).Whilst this is technically possible, it massively balloons the size of the database and can often slow down page load times... more

Jun 12, 2022

New! Drupal 9: Render A Drupal Page Within A Drupal Request

A recent challenge that I faced on a project was to generate the HTML of a full Drupal page, from within a Drupal request. The project called for a template to be rendered within the structure of a Drupal theme and also to include the styles associated with that theme.At first, this doesn't seem like a big problem, but once I started trying to figure things out it became much more complex than I was expecting.The problem is that you can't just render a page using the 'html'... more

Jun 05, 2022

New! Drupal 9: Different Update Hooks And When To Use Them

I have written lots of detail about using update hooks to manage updates in Drupal and they have all been about the hookupdateN() hook. The hookupdateN() hook is just one of the options available in running updates as the update pipeline also includes hookpostupdateNAME(). The hookdeploy_NAME() hook, bundled with Drush 10, can also be used as an update hook in the same way.Each of these update hooks has a number of different best practices when considering their use. All of these hooks are run... more

May 29, 2022

New! Seven Tips For Getting The Most Out Of Marp

The Marp suite of tools is great for creating presentations from simple Markdown rules.I've previously written about how to get up and running with Marp, but as I have been using it for a while I have come up with a few things that might be useful to know about if you are getting to grips with it.Here's a list of what I'll be talking about.Using HTML In SlidesAdding Speaker NotesUsing Spot DirectivesUsing ImagesGenerate A Presentation From A DocumentJump To A SlideCreating Custom... more

May 23, 2022

New! Drupal 9: The Correct Way To Redirect A Page

I was recently working with a Drupal 9 site and found some strange behaviour when saving certain types of content. The page would appear to save, but much of the content appeared to be missing. It had even failed to generate the paths for the page based on the path auto rules.Digging deeper I found the root cause of the problem was an improperly created redirect in an insert hook within custom code written on the site. This code looked for the creation of a particular content type and then... more

POPULAR
New! Drupal 9: Getting A Good Score In Google PageSpeed Insights
New post: Creating A Reading Progress Bar In JavaScript
New! A Look Back At My MSc Computer Science Degree Thesis
New! Run PHP Through A Browser With PHPSandbox
New! An Introduction To Object Reflection In PHP