REST API Drupal user
The user API, was originally created under the General Documenation area (see Query - user). I'm creating a new user API document under the API documentation area.
Calling a query
To call a user query the details are required:
[notice] Module {module} has an entry in the system.schema key/value storage, but is not installed
Attempting to update the database, irrespective whether I run update.php or preferred method drush updb the following errors were appearing:
Drupal contrib module changes save to a patch file
If you edit a Drupal contrib module, the next time the module is updated those edits will be wiped. So they are not lost there are a couple of options for you to consider:
- Are the edits worth the contributing to the community? Yes, you can fork the repo and add the changes for the developer(s) to review; or
- Create a patch file
Creating a patch file
The process:
Mapping out your Laravel project
Every project has to kick off somewhere. Yep well that's a no brainer. However, the number of projects that I've seen where the planning step has been omitted is too high. A throughly planned out project with as many features scoped before you start coding is critical in completing a project. Whilst projects and their requirements are always fluid, the initial critical scoping is so important.
Discovering Drupal caches
The cache system in Drupal 9 delivers the API with the elements required for creation, storage and invalidation of cached data. Drupal is structured so initially data is stored in the database. Whereas, files are stored in the following directories:
Site logo image is missing width and height
Running a few SEO and performance tests and I discovered that the site logo image tag doesn't contain a width and height variables!
How do you add image width and height to your site logo?
Working on the base that your theme file is a custom theme, then there are two files that you will need to edit:
- theme file; and
- system branding block file
How to exclude the current node from a list view
How do you exclude the current node from a list view?
In some situations, for example a block listing nodes related to the node being viewed, you might wish to exclude the current node from a list view.
Steps:
Creating a node alias path in a twig file
Do you want to know how to add a node alias in a twig file? Rather than do the set up in a custom module or using your theme file.
To be able to create a node alias in a twig file you need to know the node.nid value. Obviously without it you have nothing to reference from. In this example, the node.nid value is extracted during a loop. A fairly standard loop such as
lando PHP version issue 7.4.x instead wanting >= 8.0.2
I installed Lando 3.6.2 and Laravel 9. When I visit the web page, I getting
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28. in /app/vendor/composer/platform_check.php on line 24
Problem solving
Opening the directory in VS Code, if I run the command
php -v
The response I'm getting is
Building a Drupal or Laravel instance on OSX using Lando and Docker
As a web developer, you will most likely need to run local copies of a bunch of different web sites. Regularly switching between several sites daily. Sometime Drupal, other Laravel and whatever frameworks that are in your toolkit.
Install Docker and Lando
Do you have Docker installed? No, then go to the Docker Desktop page and download.