Short break

I've been working on multilingual support and building the English site, so new articles have been on hold. Taking this chance for a short break, I've put together a quick rundown of the site's current state and what I've been working on.

Short break.

The articles up to now have covered the environment for running Drupal and the concepts behind page creation. For the past while, though, I've been working on multilingual support and building the English pages, so new articles have been on hold. The plan was to continue with Views and Taxonomy after the Content menu overview, and I still intend to. For now, taking a short break — here's a quick rundown of the site's current state and what I've been working on.

  1. Updating Drupal Core and modules
  2. Building the English version of the site as part of multilingual support
  3. Once the English pages are complete, resuming Drupal feature coverage — explanations of Taxonomy and Views

1. Drupal Core 10.3.7.

An update notification came in, so I went ahead and updated Drupal Core 10.3.6 > 10.3.7. The update is done via Composer, following the Bitnami manual as below.

  1. Put the site in maintenance mode for the update
  2. Back up the .htaccess, settings.php, and robots.txt files.
  3. Change the working directory to the Drupal application.
  4. Upgrade the application using Composer and drush.
  5. Update the database and clear the cache
  6. Confirm that the application has been updated successfully
  7. Restore the backed-up files.
  8. Update complete — take the site out of maintenance mode.

Back up the .htaccess, settings.php, and robots.txt files.

$ cp /opt/bitnami/drupal/.htaccess /home/bitnami/.htaccess.backup
$ cp /opt/bitnami/drupal/sites/default/settings.php /home/bitnami/settings.php.backup
$ cp /opt/bitnami/drupal/robots.txt /home/bitnami/robots.txt.backup

Change the working directory to the Drupal application.

$ cd /opt/bitnami/drupal/

Run the following commands to upgrade the application using Composer and drush.

$ drush cache:rebuild
[success] Cache rebuild complete.
$ sudo composer update "drupal/core-*" --with-all-dependencies

Update starts

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 26 updates, 0 removals
- Upgrading drupal/core (10.3.6 => 10.3.7)
- Upgrading drupal/core-composer-scaffold (10.3.5 => 10.3.7)
~ ~ ~ (abbreviated) ~ ~ ~
Generating autoload files
Hardening vendor directory with .htaccess and web.config files.
45 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Cleaning installed packages.
No security vulnerability advisories found.
// Update complete
$

Update the database and clear the cache

$ drush updatedb
[success] No pending updates.
$ drush cache:rebuild
[success] Cache rebuild complete.

Confirm the update was successful

$ drush core:status
Drupal version   : 10.3.7
Site URI         : http://default
DB driver        : mysql
DB hostname      : 127.0.0.1
~ (abbreviated)
Drupal root      : /opt/bitnami/drupal
Site path        : sites/default
Files, Public    : sites/default/files
Files, Temp      : /tmp
$

Drupal has been successfully updated to version 10.3.7.


Restore the .htaccess and robots.txt backups.

$ cp /home/bitnami/.htaccess.backup /opt/bitnami/drupal/.htaccess
$ cp /home/bitnami/robots.txt.backup /opt/bitnami/drupal/robots.txt

Drupal Core has been updated from 10.3.6 to 10.3.7.

Since running Drupal on Lightsail, Core updates have gone: 10.3.3 > 10.3.5 > 10.3.6 > 10.3.7.

1-1. Meta Tag 2.1.0.

A Meta Tag 2.1.0 update notification also came in, so I updated that too. Updates can be done from the admin console, but an error was preventing it from running there, so I used Composer instead.

Update starts

$ sudo composer update drupal/metatag --with-all-dependencies
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
- Upgrading drupal/metatag (2.0.2 => 2.1.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Downloading drupal/metatag (2.1.0)
- Upgrading drupal/metatag (2.0.2 => 2.1.0): Extracting archive
Generating autoload files
Hardening vendor directory with .htaccess and web.config files.
45 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Cleaning installed packages.
No security vulnerability advisories found.
// Update the DB and clear the cache
 $ drush updatedb
[success] No pending updates.
$ drush cache:rebuild
[success] Cache rebuild complete.

Update complete

Metatag has been updated from 2.0.2 to 2.1.0.

2. Building the English Site.

I decided to try out Drupal's built-in multilingual feature and have been building an English version of the Japanese site.

Drupal's multilingual support doesn't automatically translate Japanese pages — Drupal translates specified menus and fixed fields. Articles need to be translated separately, so I translate them using DeepL, set the language to English, and create them as separate English articles.

The key point is that once a page has a language setting, a language directory is added to the URL after the domain.

On my site it looks like this:

  1. Japanese https://inter-est01.com/ja/article01
  2. English https://inter-est01.com/en/article01

All pages set to English are grouped under /en. This means block layout can be used to assign English-specific menus and sidebars, and contact form fields display in English — the site becomes fully English through these settings.

I'm currently working through translating the Drupal and Lifestyle articles written so far, and setting up the taxonomy sorting for the English version. I plan to write up the actual process in a separate article.

It's still in progress, but you can see it by selecting English from the Language option in the top menu.

The main Japanese site:

Japanese.

The Japanese pages. Since Japanese is set as Drupal's base language, this is what displays by default.

The English site under construction:

English.

The English pages. English is selected in Drupal's language settings. Articles are translated and the language for menus and other displayed elements is set to English.

3. Drupal's Information Organization Features.

The articles so far have given a brief overview and examples of page creation in Drupal, but I want to introduce the information organization features that are one of Drupal's real advantages. Views and Taxonomy — coming up in the next articles — are what I find most compelling about Drupal. The idea is to give each created page multiple category elements through Taxonomy, then extract those elements in specified ways and display them in specified formats in specified locations. This makes it possible to arrange articles and pages freely across multiple locations and present information to readers in different display formats suited to each purpose.

The flexibility of combining Taxonomy and Views for information organization is like a puzzle — once you get the feel for it, things click into place and you can organize information efficiently, exactly as you intended. I haven't fully mastered it myself, but the elegantly logical thinking behind it is part of what I find interesting about Drupal, and one of the reasons I keep using it.

I'm planning to write the explanatory articles once the English site build is complete.

Next article.

Drupal Taxonomy Part 1

An overview of Taxonomy — the foundation of Drupal's versatile information organization, which is one of its key advantages.

Last update
Contributor
S.Takeda
Article

Powered by Drupal 11.4.2 and Bootstrap 5.0.4

Published AWS Jamstack by Drupal