This project is not covered by Drupal’s security advisory policy.
Choose which Drupal Canvas page template a page gets, based on conditions.
In Canvas, a page can pick its own page template, and everything else gets the site default. That includes pages you didn't build in Canvas, like the 404 page, the login form, and the password reset form. This module lets you give those pages a different page template.
It works like block visibility, one level up. Instead of deciding which pages a block is shown on, you decide which pages a page template is used on.
Features
- Manage rules in the Canvas editor, in a "Page template rules" panel next to the page templates they use.
- Add common pages in one click: page not found, access denied, front page, log in, create account, reset password, and pages not built in Canvas.
- Use any condition plugin from core or contrib, such as pages, response status, user role, language, and content type. A rule can require all of its conditions, or any of them.
- Rules are tried in order and the first match wins. The editor warns you about a rule that can never be used because an earlier one always matches first.
- Enter a path to see which rule applies to it and why, and preview the page as a visitor gets it, before you save.
- Rules are configuration, so they can be exported and deployed like any other config.
A page that has its own page template keeps it. Rules only apply to pages that would otherwise get the site default.
Requirements
- Drupal core 11.3 or later
- Drupal Canvas with page templates (1.11 or later)
Getting started
- Install the module.
- Open the Canvas editor, and choose "Page template rules" on the left hand menu.
- Add a rule, pick its conditions, and choose a page template.
- Use "Which rule applies?" to check a path, then save.
Managing rules requires Canvas's "Administer page template" permission.
Project information
- Project categories: Content display, Site structure
- Ecosystem: Drupal Canvas
- Created by lauriii on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

