Skip to main content

git commit tag steps

Adding git tag to your actions.

The regular process that I work to is

git add -A
git commit -m "some comment"
git push

With git tag, whilst there are many options for how you can apply git tag, this initial step I'll keep simple.  As follows:

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:

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

Get the current user or load a user using a uid value

How to get the current user or load a user using a uid value.

$current_user = \Drupal::currentUser();
$user = \Drupal\user\Entity\User::load($current_user->id());

or just use

$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());

An example of this in action

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.

Subscribe to Drupal