Acquia FE Specialist (D10) study materials
Acquia FE Specialist (D10) study resources

Acquia FE Specialist (D10): Drupal Theming Fundamentals

Acquia FE Specialist (D10) · Work through your exam, one topic at a time.

All guide sections

Drupal Theming Fundamentals

What this domain covers

This domain tests your mental model of the theme layer: theme discovery, the theme registry, template and hook suggestion resolution, base themes, libraries, and regions. You should be able to explain how Drupal decides which template file renders a given piece of output.

Concepts to know

  • Theme structure: a .info.yml file declares name, type, base theme, regions, and libraries. type: theme is required. A theme without core_version_requirement may be rejected on modern Drupal.
  • Base themes: stable9 is the recommended base; classic themes like Olivero build on it. Sub-themes inherit templates and libraries from their base.
  • Theme registry and suggestions: Drupal builds a registry of hook implementations and template files. Suggestions are ordered from most specific to least specific; the first existing template wins.
  • Twig namespaces: themes register namespaces so templates can be referenced as @mytheme/....
  • Libraries: *.libraries.yml defines CSS/JS bundles; libraries-override and libraries-extend in the theme info file adjust inherited libraries.
  • Regions: declared in the info file; templates print them via {{ page.region_name }}.

Traps in questions

A frequent trap is confusing the order of template suggestions - the most specific suggestion is tried first, not last. Another is assuming a sub-theme automatically overrides all base templates; it only overrides those it actually defines. Questions may also conflate libraries-override (replace a library) with libraries-extend (add to a library).

Rule of thumb

When asked which template renders output, list suggestions from most to least specific and pick the first that exists in the active theme or its base chain.

Worked example: For a node of type article viewed in full mode, suggestions include node--article--full.html.twig, then node--article.html.twig, then node.html.twig. If only the last two exist, node--article.html.twig renders it.