
The articles on this page are ComputerMinds' contribution to the Planet Drupal aggregated article feed. Planet Drupal is intended to collate interesting and useful Drupal content from around the web.
Drupal 10 upgrade: www.computerminds.co.uk
This one is entirely on us, we wrote the custom code, which makes us responsible for maintaining it. The upgrade status module gives us a nice report of each custom project and what changes it thinks are required to bring the code up to date to work with Drupal 10. We really don't have a lot of custom module code, and the code that we do have is very simple, standard Drupal 8/9/10 stuff, so...
Drupal 10 upgrade: www.computerminds.co.uk
We're continuing our series on upgrading this very website to Drupal 10...but our first proper bit of work to upgrade this site is essentially nothing to do with Drupal 10! We built this site in the early days of Drupal 8 and Drupal core didn't really handle 'media' any differently to Drupal 7, but we wanted to try out some new modules that included having a library and drag&drop upload. However, these modules are an...
Drupal 10 upgrade: www.computerminds.co.uk
Let's define the scope and goals of our project to upgrade this very website to Drupal 10. Essentially, that's it: we want to upgrade this website to Drupal 10 so that we can benefit from security releases etc. At the moment we want to do so with the minimum of effort, so I don't want to have to be writing lots and lots of code or changing fundamentally how the site works, but I am...
Drupal 10 upgrade: www.computerminds.co.uk
On 14th December 2022 Drupal 10 was released. We can't say we immediately set about the task of upgrading all our Drupal 9 sites, but we did start thinking and planning to move all our sites in 2023. I thought it might be fun to take a look at how we do an upgrade and specifically the upgrade of this very website. So over the next few weeks we'll be slowly getting this site ready...
Drupal provides an excellent sanitisation system to filter the HTML content that editors might create. Think of it like a series of traffic cops that filter different vehicles into different lanes. Some content is allowed through to its destination, some has to be transformed along the way, and some is simply blocked from displaying. Administrators can use the 'Limit allowed HTML tags and correct faulty HTML' option to configure which HTML elements and attributes they...
Here's a super simple tip to help you work with services for Drupal in PhpStorm ( our favourite IDE). First, ensure you have enabled the Drupal Symfony Bridge and Symfony Support plugins; they're brilliant for auto-complete suggestions, and navigating around services, controllers, annotations and twig templates! I find it so helpful to be able to cmd+click (or ctrl+click) on a service name, whether in a YAML definition, or PHP code, and jump straight to the service class. But I'd noticed that PhpStorm often didn't recognise the method used after my code referred to a service like this: \Drupal::service('my_service') ->something($id);
Does writing hooks make you sad because the code is too procedural? Are you keen to use the object-oriented programming approach that Drupal and its service container enable, wherever you possibly can? Read on if you answered yes to any of those questions.
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. One of the more common components of any migration from a previous version of Drupal is the need to migrate files. In Drupal 7 there was a core ‘File’ entity type and on pretty much all of our clients' sites we would also...
Sometimes it can be handy to have extra pages for a node (or any entity). For example: * To show different sets of information on separate pages for a single product, page, or thing. * So you can set different access requirements on each page for a node. * You want to block access to the ordinary route (e.g. node/123 and its aliased equivalent) for some reason, but you still want some other page to...
I'm a fan of configuring things for display through Drupal's admin UI. It gives site builders confidence and power. What if you want to place blocks or views listings in amongst fields on pages of content? For example, to display: A listing (view) of related content, such as accessories for a product A standard contact block, advert, or some other calls to action in the middle of the content, exactly where the user is best 'caught' in their journey, rather than having to stick those in sidebars or after all the content fields. Some specific value(s) pulled from fields on some indirectly related entity, through a token, such as details from a taxonomy term representing the 'section' that a page is in. Consistent relevant links on user profiles to take people to common destinations This is where the Entity Extra Field module (entity_extra_field) comes in. It supports embedding blocks, views or values to be replaced via tokens. So a site builder can set these up to be managed just like ordinary fields on the page (whether it's a node, term, paragraph, or any other type of content).