Drupal Drupal 3 — Questions and Answers
Question 1: Which Drupal concept describes the process of moving configuration between environments using YAML files?
- Configuration Management (CMI) (Correct answer)
- Feature sets
- Database snapshots
- Module packaging
Correct answer: Configuration Management (CMI)
Drupal's Configuration Management Initiative (CMI) exports site config as YAML files that can be version-controlled and deployed.
Question 2: What is the difference between a Drupal 'block' and a Drupal 'region'?
- A region is a defined area in a theme layout; a block is a piece of content placed inside a region (Correct answer)
- A block is a full page; a region is a sub-page area
- Regions are only for menus; blocks are for text content
- They are interchangeable terms
Correct answer: A region is a defined area in a theme layout; a block is a piece of content placed inside a region
Themes define regions (header, sidebar, footer, etc.) and administrators assign blocks to those regions via the block layout UI.
Question 3: Which access control mechanism in Drupal determines what a user can do based on their role?
- Permissions system (Correct answer)
- Node access hooks
- Entity field access
- Token-based ACL
Correct answer: Permissions system
Drupal's permissions system assigns granular permissions to roles, and users inherit permissions from all roles assigned to them.
Question 4: What is 'Twig' in the context of Drupal theming?
- The PHP templating engine used to render HTML output (Correct answer)
- A Drupal module for managing assets
- A front-end build tool
- A CSS framework bundled with Drupal
Correct answer: The PHP templating engine used to render HTML output
Drupal 8+ uses the Twig templating engine, which separates business logic from presentation and auto-escapes output for security.
Question 5: In a Drupal View, what is the purpose of a 'contextual filter'?
- To dynamically filter results based on a value from the URL or current context (Correct answer)
- To apply a fixed filter visible to the editor only
- To sort results by user input
- To restrict access to view results by role
Correct answer: To dynamically filter results based on a value from the URL or current context
Contextual filters (formerly 'arguments') let a View adapt its query based on URL segments, current user, or other context values.
Question 6: What does the Drupal 'media' module provide out of the box in Drupal 9/10?
- A centralized library for managing reusable media assets like images and videos (Correct answer)
- A full video player widget
- An image CDN integration
- A file versioning system
Correct answer: A centralized library for managing reusable media assets like images and videos
The core Media module provides a media entity type so assets can be managed centrally and reused across content without re-uploading.
Question 7: Which command is used to install Drupal modules via Composer?
- composer require drupal/module_name (Correct answer)
- drush pm-enable module_name
- npm install drupal-module_name
- drush dl module_name
Correct answer: composer require drupal/module_name
Composer manages Drupal dependencies; 'composer require drupal/module_name' downloads the module and updates composer.json and composer.lock.
Which Drupal concept describes the process of moving configuration between environments using YAML files?