Skip to main content
Home
Drupal life hacks

Main navigation

  • Drupal
  • React
  • WP
  • Contact
  • About
User account menu
  • Log in

Breadcrumb

  1. Home

Drupal Theming and Layout: When to Use Paragraphs, Layout Builder, or Twig Templates

By admin, 26 June, 2025

In Drupal, Paragraphs, Layout Builder, and custom templates are all tools for controlling how content is structured and displayed — but they serve different purposes and are used in different contexts. Here's a clear breakdown of each and when to use them:


✅ 1. Paragraphs

❓ What it is:

The Paragraphs module lets site builders define reusable, flexible content components (like “Image + Text”, “Slider”, “Video”, etc.) that editors can mix and match in a structured way within content types.

✅ Use cases:

  • Editors need to build rich, structured content (like landing pages or articles).
  • You want reusable components (paragraph types).
  • You want to enforce structured data entry but with flexible layout.

🔧 Example:

You create a “Hero Banner” paragraph with an image, headline, and CTA button. Editors can add it to a page wherever allowed.

🧩 Pros:

  • Easy for content editors.
  • Structured and consistent.
  • Allows nested content blocks.
  • Can be themed per paragraph type.

❌ Cons:

  • Can get complex with deep nesting.
  • Not visual (no drag-and-drop out of the box).
  • Needs custom theming for visual layout.

✅ 2. Layout Builder (Core)

❓ What it is:

Layout Builder is a visual drag-and-drop interface for placing blocks and fields into layouts on content pages. You can override layouts per content type or per individual node.

✅ Use cases:

  • Editors want visual control over page layout.
  • You want to create custom landing pages without code.
  • You need layout flexibility on a per-page basis.

🔧 Example:

For a landing page, the editor uses Layout Builder to add a 2-column layout, place a banner block on top, and a text block next to an image.

🧩 Pros:

  • WYSIWYG drag-and-drop.
  • Can work with fields, blocks, views, etc.
  • Per-node layout override possible.
  • In core, stable and supported.

❌ Cons:

  • Less structured than Paragraphs (can be more chaotic).
  • Can become messy without editorial guidelines.
  • Needs good theming setup for styling options.
  • Less control over data structure.

✅ 3. Custom Templates (Twig)

❓ What it is:

Twig templates are used to define how content is rendered at the theme layer. This is pure theming, not for content structure.

✅ Use cases:

  • You want full control over HTML output.
  • You need performance or styling optimizations.
  • You want to hard-code layout for specific content types or pages.

🔧 Example:

You override node--article.html.twig to customize how article nodes look, or create a special page--front.html.twig for a unique homepage.

🧩 Pros:

  • Full control over markup and layout.
  • Fastest in terms of rendering.
  • Great for strict design implementation.

❌ Cons:

  • No UI — changes require code.
  • Not flexible for editors.
  • No reusable components across content types.
  • Doesn’t structure content — just renders it.

🔍 When to Use What?

SituationBest Option
Reusable content blocks with structured inputParagraphs
Visual editor wants to build layoutsLayout Builder
You need full control over HTML outputCustom Twig Template
Building landing pages with flexible layoutLayout Builder or Paragraphs
Static homepage with unique designCustom Template
Content needs nesting and structured dataParagraphs

✅ Can You Combine Them?

Yes. You can use all three together:

  • Paragraphs to create structured content blocks,
  • Layout Builder to place those blocks visually,
  • Twig templates to control how those blocks are rendered.

Tags

  • #Drupal Planet

Comments

About text formats

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Powered by Drupal