Drupal Theming & Frontend Development Flashcards
6 cards from real Drupal practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Drupal Theming & Frontend Development flashcards as text
What file is required in every Drupal theme to declare its name, regions, and base theme?
Answer: theme_name.info.yml
Every Drupal theme must have a .info.yml file declaring its name, type: theme, core_version_requirement, regions, and optional base theme.
How do you attach a CSS or JS library to a specific Twig template in Drupal?
Answer: Add {{ attach_library('mytheme/library-name') }} in the Twig file
The attach_library() Twig function loads a named library (defined in libraries.yml) only on pages where that template renders, avoiding global CSS/JS bloat.
In Drupal theming, what is the purpose of a 'preprocess function' in a .theme file?
Answer: Add or modify variables available inside a Twig template
Preprocess functions (e.g., THEME_preprocess_node()) allow theme PHP code to add, modify, or compute variables that are then passed into corresponding Twig templates.
What is a 'theme suggestion' in Drupal and how does it enable template overrides?
Answer: A prioritized list of template filenames Drupal tries before falling back to defaults
Theme suggestions give Drupal an ordered list of template filenames to try (e.g., node--article.html.twig before node.html.twig), enabling granular per-bundle overrides.
Which Drupal core theme is commonly used as a base theme for building administration-style custom themes?
Answer: Stable9
Stable9 (previously Stable) provides empty template files and no CSS, making it the cleanest base theme for fully custom themes that need no inherited styles.
What is the correct format for defining a JavaScript library with a dependency on jQuery in a Drupal libraries.yml file?
Answer: dependencies: - core/jquery
In Drupal's libraries.yml, dependencies are listed as 'package/library-name' strings under the dependencies key, and Drupal's jQuery is referenced as 'core/jquery'.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- docs.acquia.com — Retake fee, retake policy, score release, exam format, passing score, time limit, score validity, test delivery, eligibility, registration deadline · verified Oct 2026
- acquia.com — Fees, exam format, passing score, time limit · verified Oct 2026