Slots
The Slots module allows you to create customizable content placeholders throughout your Drupal site. Content editors can then add various pieces of content into these slots based on specific conditions, without needing to alter the site's configuration. This provides a flexible way to manage content like calls-to-action or promotional banners across different areas and content types.
The Slots module provides "slot" placeholders that can be placed anywhere on your site — via Block UI, Layout Builder, Views, Paragraphs, or directly in Twig — and lets content editors "push" content into them based on configurable conditions, without that content needing to live in your site's configuration.
Typical use cases:
- A placeholder in a layout where editors can drop in a CTA for a specific node type
- A piece of content in a default layout that you don't want exported to config — place a slot instead and add the content later
- Flexible CTAs inside Paragraphs, controlled entirely by conditions
- Content above a view that editors manage independently of the view's configuration
Features
- "Slot" placeable via Block UI or Layout Builder, with a configurable slot identifier and cardinality
- Content is matched to slots via the reusable
conditionscondition system — combine the "Slot" condition with any other condition (request path, language, role, ...) - Not limited to blocks — any entity type can be made slot-aware by adding a "Slots" field
- Sub-modules for Views integration (
slots_views), Paragraphs (slots_paragraphs), and Twig (slots_twig, providing aslot()Twig function) - Drag-and-drop weight ordering for content competing for the same slot
Requirements
- Conditions (
conditions_fieldsub-module) - Block plugin view builder
- Dynamic Entity Reference
Getting started
Place a "Slot" via Block UI or Layout Builder and give it a slot identifier. Then add a "Slots" field to the entity type you want to use as slot content (e.g. a block content type), enable "This content shall be displayed in slots", and add a "Slot" condition with the matching identifier — the content will now appear wherever that slot is placed.