Skip to main content
ComputerMinds

Articles

Drupal 7

Migrating Drupal 7 Files into Drupal 8 / 9 Media entities

This article assumes a basic knowledge of the building of custom modules, the Drupal 8 / 9 Migration system, and the processes behind creating customised migrations from a previous version of Drupal.Read article →

A recipe for editing & translating over 100 fields

I recently released a new contributed module to aid translation on Drupal 7 sites: Entity Translation: Separated Shared Elements Form (ETSSEF). Yes, it has a convoluted name! It finally resolves a suggestion from years ago in an Entity Translation project issue, to allow…Read article →

A New Years Resolution for maintaining your Drupal site

So 2020 is in full swing, we are already midway through February and any new year’s resolutions you may have set yourself may have slipped … but why not set yourself a new resolution of keeping on top of your Drupal site maintenance? Even as a developer working with Drupal…Read article →

Making product images consistent with image styles

We’ve recently given the dimplex.co.uk site a new face lift and stumbled across an interesting problem during development when it came to implementing the new product carousel on their product pages, more specifically, the handling of the images themselves.Read article →

Upgrading your website to Drupal 8 or 9

Update: Since writing this article the EOL of Drupal 7 has been extended from November 2021 until November 2022.Read article →

Quickly update Drupal core

Update: this article's suggested method has serious shortcomings, use other methods when you can! For example, run the following with drush to just upgrade drupal core code (leaving database updates to be run separately):Read article →

Creating multilingual variables

A super quick blast from the past today; a Drupal 7 based article!Read article →

SA-CORE-2018-004

As with every other Drupal agency on the planet, it was another fun evening of frantic patching of client sites last night due to the release of the highly critical SA-CORE-2018-004 security update for Drupal, released on 25/04/2018.Read article →

Place blocks inside your content with EBA

Previously on this website I have written about rendering blocks programmatically and adding things to content to be managed alongside fields. It's time to combine the two! On many projects, we find ourselves needing to render a block consistently across all content of a…Read article →

Making the Flag Module's Confirmation form use AJAX

This article discusses how we can use a combination of techniques to take the standard 'Confirmation Form' provided by the Flag module and get it to load in a modal window rather than on its own page. We'll also extend this form slightly to allow the user to include some…Read article →

Render a block programmatically

This is a real quick one, but so useful! We often want to render a block within content, perhaps as part of a node (maybe in hook_node_view, and then made configurable like a field), but there's no obvious way to do this correctly for any block. Drupal normally renders its…Read article →

Add stuff to a node and configure it like fields

UPDATE: The Extra Field and Extra Field Settings Provider modules facilitate doing this sort of thing in Drupal 8. Read on for older Drupal sites, and for the concepts behind this.Read article →

Rendering Drupal 7 fields (the right way)

(We have a Drupal 8 version of this article now too!)Read article →

Drupal node load references : Drupal 7

In Drupal 6, if you called node_load then what you'd be returned would be your own copy of the node to change and modify as you pleased, but in Drupal 7 this was changed. By default, what you actually get back from a node_load is essentially a reference to a global singleton…Read article →

Multiple conditions for dynamic forms in Drupal 7

Here's a quick follow-up to my original post on Dynamic forms in Drupal 7, as a reply to Wappie08, who asked me about combining conditions in the #states array to add increased control over the display of your form elements. The question:Read article →

Setting default drupal theme during installation : programatically install a drupal theme

Here's a quick post that will be a reminder for us as much as anyone else! Setting the default theme during installation using an installation profile is surprisingly hard in Drupal 6, and easier though not obvious in Drupal 7. In Drupal 6, we used the wonderful Install Profile…Read article →

Apache Solr boost Drupal search results at query-time

Boosting terms in Solr search results produced by the Apache Solr Search module that integrates Solr with Drupal is something we had to do for a project recently. If a user has come to our website from a search engine, we can pick up the terms that they had originally searched…Read article →

Creating new field formatters in Drupal 7

Creating extra field formatters in Drupal 7 is fairly simple, but it can take some poking around in the new Fields code. So here is some sample code to make it easier for you! You can add formats to your own fields -- or existing fields that are defined by other Drupal modules.…Read article →

Dynamic forms in Drupal 7

When building forms, you will often want to only provide certain options if other options are chosen by a user. For example, there's no need to show the 'open link in new window' checkbox, if the 'make this into a link' checkbox hasn't been ticked. These kinds of dynamic forms…Read article →

Certified to Rock field

Certified to Rock is a site that allows you to look-up Drupal.org user names, and see their 'certified to rock' score.Read article →