Drupal cache & twig debugging
Last updated
Was this helpful?
Last updated
Was this helpful?
Before we begin integrating components with Drupal, there are some preparation to be done and some practices to understand.
At a high level, component integration means wiring Drupal Twig templates to pre-built components from a design system such as Pattern Lab. By default Drupal has no knowledge of any components in Pattern Lab, but with the module and through the use of Presenter templates, we make Drupal aware of components so they get rendered using Drupal data while keeping Pattern Lab as the single source of truth for the component's markup, styles and javascript.
Twig debugging is not required for integrating components but it is highly recommended as this will make your job easier. Disabling caching and enabling Twig debugging during development will allow us to identify the right Drupal templates we need to work with to integrate components. These templates are typically know as template suggestion. More on this shortly.
WARNING: Disabling Drupal caching and enabling Twig debugging should never be done on a production website. This is only recommended in a development environment.