Theming Paragraphs in Drupal 8+

Last updated on
20 August 2020

Template naming conventions

Paragraphs uses template naming suggestions like core Drupal modules. The default paragraphs template is provided in paragraphs/templates/paragraph.html.twig.

The following suggestions are available, from most specific (used first) to least specific:

  1. paragraph--[type]--[view-mode].html.twig
    (e.g. paragraph--image--default.html.twig)
  2. paragraph--[type].html.twig
    (e.g. paragraph--image.html.twig)
  3. paragraph--[view-mode].html.twig
    (e.g. paragraph--default.html.twig)
  4. paragraph.html.twig

After adding a template, you must rebuild the cache in order for Drupal to discover your new template.

It is possible to create custom template name suggestions using the hook_theme_suggestions_HOOK_alter() function.

Nesting paragraphs (building a grid)

Rather than using nested paragraph types for Paragraphs-centered grid solutions, a useful addition for this use case is the module Paragraphs Grid.

See also

Help improve this page

Page status: No known problems

You can: