Skip to main content

Using paragraph.getParentEntity() in Drupal Twig templates

In Drupal Twig templates, you can set a variable like paragraph_parent to the parent entity of a paragraph using the paragraph.getParentEntity() method. This is a common approach when you want to access the parent entity (e.g., a node) that contains the paragraph.  Here's how you can do it:

Warning SameSite cookie attribute

In the Drupal Status report, I'm seeing the following message

Not set
This attribute should be explicitly set to Lax, Strict or None. If set to None then the request must be made via HTTPS. See PHP documentation

 

Watchdog page load impact on Drupal websites

In Drupal, the Watchdog module (or the logging system) is responsible for logging messages, errors, and other information related to the operation of your Drupal site. This data is useful for monitoring and troubleshooting, but it can potentially impact page load times if not managed properly.

Lando setup running Drupal 10

Create a Lando setup running Drupal 10.

The command you provided appears to be a Lando configuration command for initialising a new Lando environment for a Drupal 10 project. Following is a breakdown of the command and what it does:

Twig\Error\SyntaxError: Unknown "filter" tag

Twig error

Twig\Error\SyntaxError: Unknown "filter" tag. in Twig\Parser->subparse() (line 6 of themes/custom/{theme}/templates/views/views-view-field--products--field_product_type.html.twig).

Line 6 of the views-view-field--products--field_product_type.html.twig file is 

{% filter upper|escape('html') %}

The actual Twig file code

Drupal 9 to 10 upgrade an example of the actual steps taken

 

Continuing on from the Drupal 9 to Drupal 10 upgrade outline written earlier... Upgrading Drupal 9 to Drupal 10.  However, the point of difference is this article works through the actual action steps of the upgrade.

Planning and testing is critical for the Drupal to version 10 process to work successfully.  As some of the environments that I work in are deployed via CD/CI pipelines.

Subscribe to Drupal