Skip to main content

Lando set-up running Drupal and Python

Lando is a development environment tool that makes it easier to set up and manage local development environments for web applications. To use Python within a Lando-based development environment, you can follow these general steps:

 

Create a Lando Configuration File

Make sure you have a Lando configuration file (e.g., .lando.yml) in your project's root directory. If you don't have one, you can create it. Here's a basic example:

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

Subscribe to Drupal