Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Pinto Layout

3 sites Security covered Drupal 11 · not 10 Pinto ecosystem
View on drupal.org

This module automatically generates "Layouts" for Drupal's Layout Builder by discovering and mapping objects. It allows you to define layout regions using attributes, enabling you to create reusable layout configurations with minimal code.

Automates creation of Layouts, for Layout Builder, etc, discovered and mapped automatically.

Pinto Layout Documentation

Minimal object

Here, we'll set up an object to be a Layout in as little code as possible.

If your object doesn't conform exactly to this format, there are various other way to transform objects into layouts, whether you own the object code or not.

Setup and configure Pinto objects as usual.

use Drupal\pinto\Object\DrupalObjectTrait;
use Drupal\pinto_layout\Attribute\Region;
use Drupal\pinto_layout\PintoLayout\Data\RegionAttributes;
use Pinto\Slots\Build;

final class Obj {
  use DrupalInvokableSlotsTrait;

  public function __construct(
    #[Region]
    public readonly mixed $region1,
    #[Region]
    public readonly mixed $region2,
    public RegionAttributes $regionAttributes,
  ) {
  }
}

Associated Twig template:

<div {{ regionAttributes.containerAttributes() }}>
  <div {{ regionAttributes.regionAttributes('region1') }}>
    {{ region1 }}
  </div>
  <div {{ regionAttributes.regionAttributes('region2') }}>
    {{ region2 }}
  </div>
</div>

Note, this setup requires the following to be added to site settings.php:

$settings['twig_sandbox_allowed_classes'] = [
  \Drupal\Core\Template\Attribute::class,
  \Drupal\pinto_layout\PintoLayout\Data\RegionAttributes::class,
];

Clear container, and this object will be made available as a Layout, for use with Layout Builder.

There are other examples on how to customize these Layout objects in the example test code directory, including:

  • Customizing Layout ID
  • Customizing Layout Label
  • Pinto objects implementing an interface, as an alternative to #[Region] attribute, so you can make constructors private or custom.
  • If you do not have control over Pinto object code, you can nominate a object as a layout, by providing regions and a factory method to wire things together.

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
8
Tracked since
Oct 2025
Latest release
7 months ago
Releases (12 mo)
8 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
1.2.2 Stable 11 Jan 30, 2026
1.1.1 Stable 10 Nov 27, 2025
1.2.1 Stable 11 Nov 27, 2025
1.2.0 Stable 11 Nov 26, 2025
1.1.0 Stable 10 Nov 26, 2025
1.0.0-beta3 Pre-release 11 Oct 29, 2025
1.0.0-beta2 Pre-release 11 Oct 8, 2025
1.0.0-beta1 Pre-release 11 Oct 7, 2025