First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Drupal Fundamentals and Site Building
Which file in a Drupal theme is responsible for declaring the theme's metadata, such as its name, version, and base theme?
- theme.breakpoints.yml
- theme.libraries.yml
- theme.info.yml Correct answer.
- theme.theme
Explanation
Every Drupal theme must include a .info.yml file that defines the theme's human-readable name, its core compatibility, and optionally a base theme. Drupal's theme discovery reads this file to register the theme in the system.
Question 2Drupal Fundamentals and Site Building
A site builder wants to display a list of the five most recent articles on the front page. Which Drupal core approach accomplishes this without custom code?
- Add an RSS feed to the Article content type
- Create a View with a content block display filtered to the Article type Correct answer.
- Add a Recent content block and configure it to show only articles
- Enable the Aggregator module and import the site's own feed
Explanation
Views is the standard core tool for building configurable listings of content, and it supports filtering by content type and limiting the number of results. A block display lets the view be placed in a region.
Question 3Drupal Fundamentals and Site Building
What is the primary purpose of a content type in Drupal?
- To control which regions a block appears in
- To group users into permission-based roles
- To bundle fields and default settings that define a kind of content Correct answer.
- To assign editorial workflow states to nodes
Explanation
A content type is a bundle for the node entity; it groups a set of fields and default settings that together describe a kind of content such as an Article or Page.
Question 4Drupal Fundamentals and Site Building
Which core module must be enabled to create and manage custom fields on entities through the administrative interface?
- Entity API
- Views
- Field
- Field UI Correct answer.
Explanation
The Field module provides the field storage and API, but the Field UI module adds the administrative interface for attaching and managing fields on bundles. Both are required to manage fields through the UI.
Question 5Drupal Fundamentals and Site Building
A site builder wants anonymous visitors to see a page but not edit it. Which permission configuration achieves this?
- Grant the anonymous role the 'View published content' permission only Correct answer.
- Enable the 'Access the content overview page' permission for anonymous users
- Grant the anonymous role the 'Bypass content access control' permission
- Assign anonymous users the Administrator role
Explanation
Viewing published content is controlled by the 'View published content' permission, which can be granted to the anonymous role. Editing requires separate permissions that should not be granted to anonymous users.
Question 6Drupal Fundamentals and Site Building
What is the role of a base theme in Drupal's theme inheritance system?
- It is required for every site and cannot be disabled
- It supplies templates and assets that a subtheme can override Correct answer.
- It locks the subtheme's CSS so it cannot be changed
- It replaces the need for a .info.yml file in the subtheme
Explanation
A subtheme declares a base theme, which provides default templates, libraries, and styles that the subtheme inherits and can override. This enables reuse without copying every asset.
Question 7Drupal Fundamentals and Site Building
Which Drupal core module provides the ability to create aliases such as /about for node/12?
- Redirect
- URL Alias
- Path Correct answer.
- Pathauto
Explanation
The core Path module provides the URL alias field on content forms and manages alias storage. Pathauto, a contributed module, automates alias generation but is not in core.
Question 8Drupal Fundamentals and Site Building
Where in the administrative interface does a site builder place a block into a theme region?
- Configuration > System > Site information
- Appearance > Settings
- Structure > Block layout Correct answer.
- People > Permissions
Explanation
The Block layout page under Structure lists regions for the active theme and lets builders place blocks and configure their visibility.
Question 9Drupal Fundamentals and Site Building
A site builder needs a taxonomy term reference field that allows a single value and is displayed as a select list. Which field type and widget combination is appropriate?
- Boolean field with the Check boxes widget
- List field with the Text field widget
- Text field with the Autocomplete widget
- Entity reference field with the Select list widget Correct answer.
Explanation
Referencing taxonomy terms uses an entity reference field targeting the taxonomy term entity type. The Select list widget renders the available terms as a dropdown for a single-value field.
Question 10Drupal Fundamentals and Site Building
What does the 'Manage display' tab of a content type control?
- How the entity is indexed for search
- Which roles may view the entity
- How each field is rendered when the entity is viewed Correct answer.
- Which fields are available when editing the entity
Explanation
Manage display configures the formatters, labels, and ordering used to render each field in view modes. Manage fields, by contrast, controls the field definitions and widgets.
Question 11Drupal Fundamentals and Site Building
A site builder wants the same article to appear differently on a teaser listing and on its full page. Which Drupal feature is used?
- View modes with per-mode field display settings Correct answer.
- Access control handlers
- Revision log messages
- Content moderation states
Explanation
View modes let an entity be rendered with different field formatters and ordering depending on context, such as Teaser versus Full content. Field display is configured separately per view mode.
Question 12Drupal Fundamentals and Site Building
Which statement best describes the relationship between a View and a block display?
- A block display is a content type used to store View results
- A block display replaces the View's page display when enabled
- A block display is one output format of a View that can be placed in a region Correct answer.
- A block display is a separate View that cannot share filters
Explanation
A single View can expose multiple displays, such as a page and a block, that share the same query and filters. A block display is placed in a theme region like any other block.
Question 13Drupal Fundamentals and Site Building
A site builder wants unpublished content to be invisible to anonymous users while remaining visible to editors. Which configuration most directly accomplishes this?
- Set the front page to a view filtered to published content
- Disable the node access system entirely
- Grant 'View own unpublished content' to editors and withhold it from anonymous users Correct answer.
- Enable the 'Bypass content access control' permission for anonymous users
Explanation
Node access grants viewing of unpublished content through specific permissions like 'View own unpublished content'. Editors with that permission can see their unpublished nodes while anonymous users cannot.
Question 14Drupal Fundamentals and Site Building
What is the purpose of the 'Manage form display' configuration for a content type?
- To define which users may create content of that type
- To determine the HTML output of fields on the rendered page
- To set the default workflow state for new content
- To choose the widget and order of fields on the entity edit form Correct answer.
Explanation
Manage form display configures the widgets used for each field and their order on the add/edit form. It is separate from Manage display, which controls rendering.
Question 15Drupal Fundamentals and Site Building
Which Drupal core configuration entity stores a reusable set of field display settings for a view mode?
- View
- Entity form display
- Field storage
- Entity view display Correct answer.
Explanation
Entity view display configuration entities store the component and formatter settings used to render an entity in a particular view mode. Entity form display is the analogous configuration for edit forms.
Question 16Drupal Fundamentals and Site Building
A site builder creates a taxonomy vocabulary 'Tags' and wants a free-text tagging experience on articles. Which field configuration supports this?
- A list field limited to integer keys
- A boolean field with a checkbox widget
- An entity reference field to taxonomy terms using the Autocomplete widget with 'Create referenced entities if they don't already exist' enabled Correct answer.
- A text field with a select list of predefined options
Explanation
Tagging is implemented with an entity reference field to taxonomy terms using the autocomplete widget, which can create new terms on the fly when the option is enabled.
Question 17Drupal Fundamentals and Site Building
Which configuration is required for a contributed theme to appear on the Appearance page?
- An entry in the site's settings.php file
- A corresponding module with the same name
- A compiled CSS file in the theme root
- A valid .info.yml file placed in a theme directory Correct answer.
Explanation
Drupal discovers themes by scanning for .info.yml files in theme directories. Without a valid info file, the theme is not registered and cannot be installed.
Question 18Drupal Fundamentals and Site Building
A site builder needs a listing of articles filtered by a taxonomy term supplied in the URL, such as /articles/technology. Which View feature supports this?
- A contextual filter on the taxonomy term ID Correct answer.
- A grouped filter on the content type
- An exposed filter on the title
- A relationship to the author
Explanation
Contextual filters take their value from the URL path and filter the query accordingly. A contextual filter on a taxonomy term reference field allows paths like /articles/technology to filter by term.
Question 19Drupal Fundamentals and Site Building
Which statement accurately describes how Drupal distinguishes configuration from content?
- Configuration describes site structure and is exportable; content is stored as entities and is not part of configuration export Correct answer.
- Configuration and content are both exported together by default
- Content is stored in YAML files while configuration lives in the database
- Configuration changes require clearing the cache while content changes do not
Explanation
Drupal's configuration system stores structural settings that can be exported to YAML and moved between environments. Content entities such as nodes and terms are stored in database tables and are not part of configuration synchronization.
Question 20Drupal Fundamentals and Site Building
A site builder wants an image field to render at different crops on desktop and mobile. Which combination of core features is most appropriate?
- Responsive image styles using breakpoints and image styles Correct answer.
- The Image field's alt text setting
- A media reference field without styles
- A single image style applied to all view modes
Explanation
Responsive image styles map breakpoints to image styles so the browser can select an appropriately sized image. This requires breakpoints and image styles configured in the theme and site.
Question 21Drupal Fundamentals and Site Building
Which Drupal core module provides the ability to define a block whose content is a custom, reusable chunk of formatted text?
- Block Content Correct answer.
- Layout Builder
- Block
- Custom Block UI
Explanation
The Block Content module defines custom block entities that store reusable formatted content and can be placed like other blocks. The Block module provides the placement system itself.
Question 22Drupal Fundamentals and Site Building
A site builder enables a new module that adds a field to an existing content type. Which action is typically required for the new field to appear on the content edit form?
- Delete and recreate the content type
- Rebuild the theme registry only
- Re-export configuration and import it into the same site
- Configure the field's widget on the Manage form display page Correct answer.
Explanation
A field must be assigned a widget and made visible in the form display for its bundle. Newly added fields may be hidden by default and must be enabled on Manage form display.
Question 23Drupal Fundamentals and Site Building
Which statement best explains why a subtheme's template file takes precedence over the same-named template in its base theme?
- The base theme's templates are disabled once a subtheme is installed
- Templates are loaded alphabetically by file name
- Template precedence is determined by file modification time
- Drupal's theme registry searches the active theme first and falls back to base themes Correct answer.
Explanation
Theme inheritance builds a registry that checks the active theme before its base themes, so a template in the subtheme overrides the base theme's version. This is the mechanism behind template overriding.
Question 24Drupal Fundamentals and Site Building
A site builder creates a View with a page display at /news and later changes the path to /updates. What happens to the previously configured menu link for the View?
- The View's page display is disabled until the menu link is deleted
- The menu link must be updated to the new path or it will point to a non-existent route Correct answer.
- The menu link automatically follows the path change
- The old path continues to work as an alias
Explanation
Menu links store a route or path reference; changing a View's path does not automatically rewrite an existing menu link. The link must be edited so it resolves to the new path.
Question 25Drupal Fundamentals and Site Building
Which configuration object controls the machine name and allowed values of a list field attached to a content type?
- The permissions configuration
- The field storage configuration Correct answer.
- The content type's bundle settings
- The entity view display configuration
Explanation
Allowed values for list fields are part of the field storage settings, which define the field's data model. Display and form settings reference the field but do not define its allowed values.
Question 26Drupal Fundamentals and Site Building
Which Drupal core module must be enabled for a site builder to create a new content type through the administrative interface?
- Taxonomy
- Node Correct answer.
- Field
- Menu UI
Explanation
Content types are configuration entities owned by the Node module, which supplies the entity type, bundles, and the Content types administration page. Enabling Node therefore exposes the ability to add bundles such as Article or Page.
Question 27Drupal Fundamentals and Site Building
In Drupal, what does a view mode define?
- A named set of field formatter settings used to render an entity Correct answer.
- A translation workflow for content entities
- A permission set granted to an editorial role
- A saved set of filters applied to a View listing
Explanation
View modes are configuration entities that bundle display settings, letting one entity be rendered in multiple presentations such as Teaser or Full content. Each view mode has its own Manage display configuration per bundle.
Question 28Drupal Fundamentals and Site Building
A site builder wants visitors to reach a page listing at /products. Which configuration on a View page display makes that URL resolve?
- A path set in the page display's path settings Correct answer.
- A menu link placed in the footer menu
- A URL alias created for the View's machine name
- A contextual filter argument
Explanation
A page display registers a route from the path entered in its page settings, which is what makes the listing reachable at that URL. Menu links and aliases reference the resulting route rather than create it.
Question 29Drupal Fundamentals and Site Building
Which entity type does Drupal use to store reusable sets of field values that are attached to other entities?
- Content entities Correct answer.
- Base fields
- Vocabulary entities
- Configuration entities
Explanation
Content entities hold user-generated, deployable data such as nodes, users, taxonomy terms, and custom block content. Their field values live in content tables and are not exported with configuration.
Question 30Drupal Fundamentals and Site Building
A site builder needs a field that lets editors pick exactly one of three fixed options, stored as a machine-readable key. Which core field type fits best?
- Entity reference
- Boolean
- Text (plain)
- List (text) Correct answer.
Explanation
List (text) stores a key from a defined allowed-values list while displaying a separate human-readable label. It is the standard core choice for a fixed set of selectable options.
Question 31Drupal Fundamentals and Site Building
What is the effect of marking a field as required on the Manage form display for a content type?
- The field is excluded from all view modes
- A value must be supplied before the entity can be saved Correct answer.
- The field is hidden from anonymous users
- The field value cannot be edited after saving
Explanation
The required flag enforces validation at the entity level, so saving fails until a value is present. It applies to programmatic and form submissions alike.
Question 32Drupal Fundamentals and Site Building
A site builder wants a taxonomy term page to list all nodes tagged with that term. Which approach relies only on core functionality?
- Create a menu link on each term pointing to a search query
- Create a View with a taxonomy term ID contextual filter and enable it as a taxonomy term page Correct answer.
- Add a term reference field to the term and point it at the nodes
- Enable the Aggregator module and import the nodes as feeds
Explanation
A View with a contextual filter on the term ID can be bound to the taxonomy term route, producing a listing per term without custom code. This is the standard core pattern for term listings.
Question 33Drupal Fundamentals and Site Building
Which statement describes how Drupal treats a content type's configuration when a site is deployed from one environment to another?
- It is exported with configuration synchronization because content types are configuration entities Correct answer.
- It is recreated automatically whenever the Node module is enabled
- It travels with the database dump and cannot be exported separately
- It is exported only if the Deploy module is installed
Explanation
Content types are configuration entities, so their definitions and attached field configuration are part of the configuration system and can be synchronized between environments. The content stored in them remains in the database.
Question 34Drupal Fundamentals and Site Building
A site builder creates a block type with the Block Content module and places one instance in a region. What is being placed?
- A menu link that points to the block's canonical page
- A content entity whose values are stored per placement
- A plugin definition written in a theme's YAML file
- A configuration entity that renders the block content entity Correct answer.
Explanation
The custom block itself is a content entity, while the block placed into a region is a block configuration entity that references it. This separation lets the same custom block be reused in multiple placements.
Question 35Drupal Fundamentals and Site Building
A site builder needs the article teaser to link to the full node. Which core setting on the Manage display page accomplishes this?
- Enabling the 'Link to content' option on the node's title field formatter Correct answer.
- Adding a read-more field to the content type
- Configuring a contextual filter on the teaser
- Setting the view mode to Full content
Explanation
The title field formatter offers a link option that wraps the rendered title in an anchor to the entity's canonical URL. This is the standard core way to make teasers navigable.
Question 36Drupal Fundamentals and Site Building
A site builder wants a single piece of formatted text, such as a footer notice, to appear in a region on every page and to be editable by a non-developer. Which core approach is appropriate?
- Hard-code the text in the theme's page template
- Create a custom block and place it in the region Correct answer.
- Create a node and rely on its URL alias
- Add the text to the site slogan in the theme settings
Explanation
A custom block created with Block Content is editable through the UI and can be placed in a region so it renders site-wide. This keeps the text out of code and in manageable configuration and content.
Question 37Drupal Fundamentals and Site Building
Which configuration entity stores the allowed values for a List field attached to a bundle?
- field.field.* Correct answer.
- core.entity_form_display.*
- core.entity_view_display.*
- field.storage.*
Explanation
The field.field configuration holds bundle-level settings, including allowed values for list fields, because those settings belong to the field instance. Storage-level settings live separately.
Question 38Drupal Fundamentals and Site Building
A site builder changes the path of an existing View page display from /news to /updates. What is the immediate result?
- A redirect from /news to /updates is created automatically
- The View is reachable at /updates and /news stops resolving to it Correct answer.
- Both paths continue to work because the old route is cached
- The change is rejected until the View cache is cleared manually
Explanation
The page display's path defines its route, so saving a new path replaces the old one and old bookmarks no longer match. Redirects are not generated automatically by changing a View path.
Question 39Drupal Fundamentals and Site Building
A site builder needs different field formatting for the same content type depending on whether it is shown in a View's teaser listing or on its full page. Which core mechanism provides this?
- Two view modes with separate display settings, selected per context Correct answer.
- Two vocabularies with different term displays
- Two content types sharing the same fields
- Two field storages with different formatters
Explanation
View modes let the same entity render through distinct sets of formatter settings, and a View row or the full page can each request a different mode. This avoids duplicating fields or bundles.
Question 40Drupal Fundamentals and Site Building
A site builder wants a View listing to show only nodes whose moderation state is published, while editors previewing the page should see drafts too. Which combination of core features achieves this?
- A filter on published status plus a permission-based filter using the current user Correct answer.
- A contextual filter on the node ID plus a pager setting
- A sort on the moderation state plus aggregation
- A filter on the moderation state plus a relationship to the revision author
Explanation
Content moderation stores state on the revision, but the published status on the base table combined with a filter on the current user's permission can separate public and editorial views. Alternatively, access checks on the View respect the viewer's permissions.
Question 41Module and Theme Development
Which file in a custom module declares its routes to Drupal's routing system?
- routing.yml Correct answer.
- services.yml
- links.menu.yml
- module.routing
Explanation
Drupal discovers routes from a file named <module>.routing.yml in the module root. The routing system parses YAML route definitions and registers them with the router. Other YAML files serve different subsystems.
Question 42Module and Theme Development
What is the purpose of the hook_theme() function in a module or theme?
- It declares theme hooks and their default variables and templates. Correct answer.
- It lists the module's dependencies for installation.
- It defines permission definitions for the access system.
- It registers render element types for the Form API.
Explanation
hook_theme() returns an array describing each theme hook, including its variables, template file, and render element defaults. The theme system uses this registry to render output.
Question 43Module and Theme Development
In a module's .info.yml file, which key specifies the module's human-readable name shown on the Extend page?
- label
- name Correct answer.
- title
- description
Explanation
The name key in the info.yml file provides the display name of the module or theme. The description key provides the summary text below it.
Question 44Module and Theme Development
Which annotation is used on a PHP class to register a custom block plugin?
- @Plugin
- @BlockPlugin
- @RenderElement
- @Block Correct answer.
Explanation
Block plugins are discovered via the @Block annotation on a class extending BlockBase. The annotation includes an id and admin_label. Plugin managers read these annotations during discovery.
Question 45Module and Theme Development
Which Twig function outputs a rendered render array or theme hook in a template?
- {{ render() }} Correct answer.
- {{ drupal_render() }}
- {{ output() }}
- {{ print() }}
Explanation
The render() Twig function converts a render array into markup. It is the standard way to output structured render arrays from templates.
Question 46Module and Theme Development
What does the #markup render array property do?
- It supplies pre-rendered HTML that is output directly. Correct answer.
- It marks an element as cacheable.
- It attaches JavaScript libraries to the element.
- It defines an access callback for the element.
Explanation
#markup provides a string of HTML that the render system outputs, after filtering for safety where appropriate. It bypasses theme functions but is still processed by the render pipeline.
Question 47Module and Theme Development
Which YAML file in a theme declares its regions and base theme?
- <theme>.info.yml Correct answer.
- <theme>.breakpoints.yml
- <theme>.libraries.yml
- theme.yml
Explanation
A theme's info.yml file declares properties such as base theme, regions, and libraries. Drupal reads it during theme discovery.
Question 48Module and Theme Development
Which method on a service class is used to declare its dependencies when it implements ContainerInjectionInterface?
- instantiate()
- setDependencies()
- inject()
- create() Correct answer.
Explanation
ContainerInjectionInterface requires a static create() method that receives the container and returns an instance. The container calls create() to construct the object with its dependencies.
Question 49Module and Theme Development
A developer wants a controller method to be reachable at /custom/report and only by users with the 'view reports' permission. Which routing.yml entry is correct?
- custom.report: route: '/custom/report' controller: 'ReportController::report' access: 'view reports'
- custom.report: url: '/custom/report' defaults: { _controller: 'ReportController::report' } requirements: { _role: 'view reports' }
- custom.report: path: '/custom/report' defaults: { _controller: '\Drupal\custom\Controller\ReportController::report' } requirements: { _permission: 'view reports' } Correct answer.
- custom.report: path: '/custom/report' handler: 'ReportController::report' permission: 'view reports'
Explanation
Route definitions require a path key, a _controller default, and an access requirement such as _permission. The route name is the top-level YAML key.
Question 50Module and Theme Development
A module needs to alter a form built by another module. Which hook should it implement?
- hook_form_alter() Correct answer.
- hook_alter_form()
- hook_form_build_alter()
- hook_forms_alter()
Explanation
hook_form_alter() lets modules modify any form's structure before it is rendered. More specific variants like hook_form_FORM_ID_alter() target a single form.