Mar 19, 2023

New! Creating Tic Tac Toe In JavaScript Part 1: The Game

Tic Tac Toe (or noughts and crosses) is a good game to create when learning game development as it has simple rules and a known win state. I have created a version of tic tac toe using PHP before, but I wanted to see if I could re-create the game in JavaScript using the canvas element. This is certainly possible to do as everything we need is built into JavaScript itself, which means we don't need to import any packages to get this working.In this article I will go through the necessary... more

Mar 05, 2023

New! Generating Histogram Colour Analysis Graphs From Images In PHP

If you've ever looked at the settings in a digital camera, or have experience with image processing programs like GIMP, then you may have seen a colour histogram. This is a simple graph that shows the amount of different shades of colour are present in the image.They are created by looking at the number of colours in a given image and them mapping their red, green and blue values against a the frequency of their occurrence in the image.Colour histograms are useful for looking at the... more

Feb 19, 2023

New! Drupal 10: Creating Context Aware Plugins

In previous articles I have written about injecting context into context aware plugins and creating custom context providers and wanted to complete the series by writing about creating context aware custom plugins.The context system in Drupal is a powerful way of injecting dynamic data into plugins without writing code to add that data directly to the plugin itself. Instead of adding custom code to find the current user or the node from the route of the page you can inject the context... more

Feb 05, 2023

New! Drupal 10: Migrating Flags With The Migrate Module

I've been doing a bit of Drupal migration recently, and one of the tasks I have undertaken is to migrate "likes" from a Drupal 7 site to a Drupal 10 site.The likes in the old Drupal 7 site were built using a custom module, with the Flag module was selected to provide the new functionality on the new Drupal 10 site. This meant that I needed to migrate the old custom structure into the entity structure provided by the Flag module.To add further complication, it... more

Jan 29, 2023

Drupal 10: Programmatically Injecting Context Into Blocks

Context definitions in Drupal are really useful when you want to inject context into your plugins and I have been using them for a little while now. It has made building custom blocks to add content to pages much easier as I don't need to copy the same block of code to find an entity of a particular sort into the block plugin.One problem I encountered when using this technique was when trying to programmatically create and render a block. The problem was that the context wasn't... more

Jan 22, 2023

New! Drupal 10: Creating Custom Context Providers

I previously looked at injecting context providers into context aware plugins. This time I will explore more about creating our own context providers to plug into this system.The context provider system is an ideal way to provide context to context aware plugins, with blocks being the prime example. You would use a context provider to inject an entity or value into the block so that actions can be taken using that data.For example, we could load the current node from the route using context so... more

New! Drupal Testing Strategies
New! Using PSR-4 With Composer
New! Drupal 9: Creating A Minimal Content Entity
New! Drupal 9: Creating A Category Menu Using Derivers
New! Reading User Files Using Tkinter In Python
Support !# code (Hash Bang Code)
You’ll be charged £

Payment secured by  . You’ll be taken to a thank you page after the payment. Terms and Privacy.

!# code (Hash Bang Code)

You’ll be charged £

Enter a fair price


Payment secured by  . You’ll be taken to a thank you page after the payment. Terms and Privacy.