Category: Drupal
How to Create and Use Drupal 8+ Services: A Detailed Guide with Practical Code
Drupal, the open-source content management system, has come a long way since its inception. With the release of Drupal 8, we saw a massive shift in the underlying architecture: the adoption of a more object-oriented programming approach using Symfony components. One notable component that was introduced in Drupal 8 is the service container, which has…
Setting Up a Drupal 9 Multisite Locally with DDEV: Hosted on Acquia with Acquia Pipelines
In my current job, the team that I lead is providing support to three websites of a large private organization. The three websites are hosted on Acquia. The websites are part of a multisite setup and the source code is managed using the Acquia Pipelines service. In a nutshell, Acquia Pipelines is a continuous integration…
How to create pseudo fields in Drupal using 2 hooks
What are pseudo fields? In Drupal, pseudo fields are fields that do not store data in the database, but rather dynamically generate content on the fly. Pseudo fields allow site builders and developers to add custom content to entities (such as nodes, users, and taxonomy terms) without needing to create a separate field for it.…
What are the benefits of PHP 8.1 and the Commands to upgrade from an older version on Nginx?
PHP 8.1 is the latest version of the popular server-side scripting language, and it brings a host of new features and improvements that make it a compelling choice for developers. In this article, we’ll highlight some of the key benefits of upgrading to PHP 8.1.
Drupal 10, a quick overview
Drupal 10 is the latest version of the popular open-source content management system (CMS) Drupal, released on December 14th, 2022. It marks the culmination of over two years of development and brings with it numerous new features and improvements. One of the key features of Drupal 10 is its support for modern web development practices.…
How to step debug PHP code with Xdebug and PhpStorm on a DDEV setup
What is debugging? Per wikipedia: “In computer programming and software development, debugging is the process of finding and resolving bugs (defects or problems that prevent correct operation) within computer programs, software, or systems.” Per Internet: “Debugging is like being the detective in a crime movie where you are also the murderer.” – Filipe Fortes What…
How to redirect from www to non-www URL using Cloudflare for free
After doing a quick SEO audit to this website, I found that https://davidloor.com/ and https://www.davidloor.com/ were both up. Since search engines see them as two different websites, it may arises issues because of duplicated content. So, I needed to pick one of the domains and redirect the other to the one selected. On the internet…
Drupal 8+ media module does not create the default bundles (Media Types) after installation
When the media module that is part of the the Drupal 8+ core is installed, we expect that the default media entity types, [Document, Image, Audio file (local), Video file (local), Remote video ] get created automatically, so they are available when creating a new media field. But, that is the case when we are…
The most used drush commands in Drupal 8+
drush status drush cex –destination=path/to/export-config drush cim drush updb drush generate drush sql-dump –gzip –result-file=./sites/default/files/YOUR-FILE-NAME.sql Export a database compressed as gzip
How to check quickly if your website is protected against DoS attacks?
The objective of this quick how-to is to explain how to perform a stress test against your site and see how it behaves under extreme load. The Open Source tool that we are using for this test is the HTTP benchmarking tool wrk.