Drupal planet

Tous nos billets sur le thème Drupal planet

Prevent unsolicited mass submissions on its Drupal 9 (or Drupal 8) site

Several anti-spam solutions exist on Drupal to prevent the submission of forms (contact, newsletter subscription, etc.) by more or less well-intentioned robots. Without wanting to be exhaustive, we can use the Honeypot and Antibot modules which provide (different) non-intrusive defence mechanisms, or the captcha / recaptcha modules which ask the visitor to respond to different challenges before allowing him to submit the form.

Automatically integrate email via CSS styles with Drupal 8

How do you put colors in your emails sent from your Drupal 8 site? Very often, integrating emails from a Drupal 8 site, or from any website, can be (very) time consuming, with strong constraints in terms of email rendering to have a correct rendering on all types of email or webmails. Discover how to automatically integrate email via CSS styles with Drupal 8.

Starting a migration with Migrate programmatically

Migrate, a module integrated into the Drupal 8 Core, is a powerful solution for setting up data import processes from any data source (CSV, XML, Database, JSON, etc.) to a Drupal 8 project. The purpose of this post is not to explore all the facets of Migrate, as they are numerous and are already covered in many blog posts or official documentation, but rather to address a particular point: how to programmatically launch a migration?

Export content to CSV with Drupal 8

The need to export the contents of a Drupal 8 project is a recurring need, whether for analysis purposes or for mass updating with a concomitant import process. We have several solutions with Drupal 8, each of which has advantages and disadvantages, whether in terms of the content types that can be exported, the options for exporting column headers and values, the level of access rights required and the highly variable configuration options. We will present here a new Entity Export CSV module that seems to be able to respond to many use cases.

Easily reorder nested paragraphs with Drupal 8

The Paragraph module allows, among other uses, to propose various and varied structured layouts according to the needs of a project, directly accessible and manageable by a content editor, without any particular administration rights. One of the major drawbacks I have encountered with Paragraph, for the design of complex landing pages, is the impossibility to change the parent of a paragraph in the case of nested paragraphs. As a user of the Paragraph module for many years, I may not have read all the release notes of the module. And that's probably why I'm only now discovering that the Paragraph module now natively offers a drag and drop function that allows you to completely reorder the layout of paragraphs, whether or not they are nested in other paragraphs.

Add a relationship to a View programmatically with Drupal 8

To make queries and build listing pages on Drupal 8, or any other content to collect, we have EntityQuery, the API Database (see Make a SQL query on multiple tables with Drupal 8) or the Views module which provides us an extremely powerful requester and graphical interface. Each of these methods has its advantages and disadvantages and may be more appropriate in certain situations (complexity of the request, etc.).

Invalidate the page cache according to a duration with Drupal 8

For some purposes it may be necessary to have content, or content elements, that may vary according to a certain time period, and therefore require a cache invalidation according to a certain duration. This is for example the typical case of a list of future and/or past events, which must invariably change over time.

Drupal 8 has three cache systems: