> For the complete documentation index, see [llms.txt](https://docs.varbase.vardot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.varbase.vardot.com/developers/theme-development-with-varbase/drupal-canvas/editing-the-header-and-footer-with-drupal-canvas.md).

# Editing the Header and Footer With Drupal Canvas

How to edit and change the header and footer of a Vartheme BS5 site in its Drupal Canvas page template, without writing any code.

**Varbase** ships with **Drupal Canvas**, a visual page builder, and the **Vartheme BS5** (Bootstrap 5) base theme. With Drupal Canvas you can edit the site **Header** and **Footer** directly in the browser, with no code and no template overrides. The header and footer belong to a **page template**: a change you publish to the template appears on every page that uses it.

This page explains where the page template comes from, how to open it in the editor, edit the header and footer components, and publish the result.

{% hint style="info" %}
In **Drupal Canvas** 1.11 and later, **page templates** replace the older global regions. Each page template is one full-page layout that holds the **Header**, the **Footer**, and a **Page content** marker that shows where each page's own content appears.
{% endhint %}

## Before You Begin

* A working **Varbase** site (Varbase 11 or later) with the **Drupal Canvas** module enabled.
* **Vartheme BS5** set as the default theme (**Administration** \ **Appearance** \ ***Vartheme BS5***).
* A user account with the **Administer page template** permission (see **Permissions** below). The **Site Admin** and **Super Admin** roles have it by default.

## Permissions

Creating and editing page templates, and choosing the site default, needs one permission in the **Drupal Canvas** group:

| Permission                   | Machine name               | What it allows                                                                     |
| ---------------------------- | -------------------------- | ---------------------------------------------------------------------------------- |
| **Administer page template** | `administer page template` | Create and edit the page templates that render pages, and choose the site default. |

Grant it at **Administration** \ **People** \ ***Permissions*** (`/admin/people/permissions/module/canvas`), in the **Drupal Canvas** group.

{% hint style="warning" %}
Changes to a page template reach every page that uses it. Grant **Administer page template** only to trusted roles, such as **Site Admin** and **Super Admin**. Users without it still see the page template in the editor, but cannot open it.
{% endhint %}

For a role without this permission, such as **Content editor**, the editor still requests `/canvas/api/v0/settings/default-page-variant`, which answers 403, and the browser console logs "RTK Query error: ... The 'administer page template' permission is required." The editor works normally; allow the message if your automated tests fail on console errors.

## The Vartheme BS5 Page Template

The page template is created when **Drupal Canvas** is turned on for the theme.

1. Navigate to **Administration** \ **Appearance** \ **Settings**\
   ***Vartheme BS5*** (`/admin/appearance/settings/vartheme_bs5`).
2. In the **Drupal Canvas** section, make sure **Use Drupal Canvas for page templates in this theme.** is on.
3. Click **Save configuration.**

![Use Drupal Canvas for Page Templates in the Vartheme BS5 Settings](https://410909369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcuWLZ87gvtX5vA2YGD%2Fuploads%2Fgit-blob-edb1967082324e1177b1d52da9d124a5b2fe5790%2Flearn-09-theme-canvas-page-templates-setting.png?alt=media)

Saving with the option on creates the **Vartheme\_bs5 theme** page template from the theme's current header and footer and makes it the site default.

{% hint style="info" %}
On a standard **Varbase** install this option is already on, so in most cases you can skip straight to opening the editor.
{% endhint %}

## Opening the Page Template

The page template is opened from inside any page editor.

1. Navigate to **Administration** \ **Content** \ ***Pages*** and open a Drupal Canvas page (for example, the **Home** page) in the editor, or go to `/canvas/editor/canvas_page/<id>`.
2. Wait for the editor to finish loading. The page preview shows the **Header** at the top and the **Footer** at the bottom, exactly as visitors see them.

![The Drupal Canvas Editor Showing the Home Page With Its Header](https://410909369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcuWLZ87gvtX5vA2YGD%2Fuploads%2Fgit-blob-6d19ab1625dfa68d66c7c5633811b992abd93436%2FCanvas%20Header%20Footer%20-%20Page%20Editor%20Overview.png?alt=media\&token=1b194367-d10a-4647-9fab-e75a6943b391)

3. Open the page template in one of two ways:
   * In the left toolbar, click the **Layers** icon. The page's **Content** tree sits under a locked layer named after its page template, **Vartheme\_bs5 theme**. Click that layer.
   * In the left toolbar, open the **Templates** panel. Under **Page templates**, click **Vartheme\_bs5 theme** (marked **Default**).

![The Page Template Layer Above the Page Content in the Layers Panel](https://410909369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcuWLZ87gvtX5vA2YGD%2Fuploads%2Fgit-blob-541d703e11a2a881b2faf50b258da815c220e2fc%2Flearn-08-layers-panel.png?alt=media)

![Page Templates in the Templates Panel](https://410909369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcuWLZ87gvtX5vA2YGD%2Fuploads%2Fgit-blob-c6409ff2ed534f72f15919d9abf7b742ada6b093%2Flearn-09-templates-panel.png?alt=media)

{% hint style="warning" %}
On one Varbase 11 site, opening the page template (`/canvas/editor/page_variant/theme_vartheme_bs5`) with no edit at all marked it **Changed** and showed **Review 1 change**. Three auto-save entries were stored for whoever opened it: the page variant and the staged Arabic and French config overrides. Before anyone publishes, check **Review changes** and discard entries nobody made. See [Known Issues on a New Varbase 11 Site](https://docs.varbase.vardot.com/developers/known-issues-on-a-new-varbase-11-site.md).
{% endhint %}

On a page, the header and footer components are shown but locked. They are edited only in the page template, so a change there applies to every page that uses it. The **Page template** setting in a page's **Page data** panel chooses which template renders that page.

## Editing the Header

In the page template, the **Header** holds a **Section** with the **Site Branding** logo, the **Main navigation** menu and the search toggle.

1. In the **Layers** panel of the page template, expand **Header**.
2. Click any component inside the header (for example, the **Site Branding** logo or the **Main navigation** menu) to select it.
3. Use the settings panel on the right to change the component's properties, or use the **Library** (the **+** icon) to add a new component into the header.
4. Drag components in the **Layers** panel to reorder them, or use a component's context menu (**…**) to **Duplicate** or **Delete** it.

{% hint style="info" %}
The **Page content** marker shows where each page's own content appears. It cannot be deleted or duplicated, only moved.
{% endhint %}

### Example: Adding a Red Outline Donate Button Before the Header Menu

This example drags a ready-made **Button** component into the header, places it **before** the **Main navigation** menu, and styles it as a red outline button.

1. Open the **Vartheme\_bs5 theme** page template, then open the **Library** (the **+** icon) and search for **Button**.
2. **Drag** the **Button** component into the header and drop it **before** the **Main navigation** menu. Drupal Canvas shows a drop indicator as you drag.
3. Select the new button and change its props in the **Settings** panel:
   * **Variant** → **Danger** (red)
   * **Outline** → **On** (uses the Bootstrap `btn-outline-*` style)
   * **Size** → **Small** (`btn-sm`)
   * **Label** → `Donate`
   * **Link URL** → `/donate`
4. Click **Publish.**

![Changing the Button Props in the Settings Panel](https://410909369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcuWLZ87gvtX5vA2YGD%2Fuploads%2Fgit-blob-e2eee231f028a7cf49707d764924da9b7c0904fb%2FCanvas%20Header%20Footer%20-%20Button%20Props.png?alt=media\&token=6698a0fe-87ee-4412-9fea-3b4fd21d374b)

![The Red Outline Donate Button, Before the Main Menu](https://410909369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcuWLZ87gvtX5vA2YGD%2Fuploads%2Fgit-blob-74920974d3967bab28e9d2d760fd0ab5afc25ebe%2FCanvas%20Header%20Footer%20-%20Example%20Donate%20Button.png?alt=media\&token=4ce4f9e6-5f2b-4f30-9755-5b88be665e21)

## Editing the Footer

In the page template, the **Footer** holds two **Section** components with the footer, secondary and social media menus.

1. In the **Layers** panel of the page template, expand **Footer**.
2. Edit the footer the same way as the header: select a component to change its settings, add new components from the **Library**, reorder them in the **Layers** panel, or remove them.

### Example: Adding a Newsletter Webform Under the Footer Social Menu

This example places the **Newsletter Subscribe** webform in the footer, **under** the social media links menu, so visitors can sign up from any page.

{% hint style="info" %}
**Newsletter Subscribe** ships with no handlers: sign-ups are stored, but nobody is notified and no address reaches a mailing list. Add an email handler or a mailing list integration before the form goes live. See [Varbase Webform Base](https://docs.varbase.vardot.com/developers/understanding-varbase/varbase-recipes/varbase-webform-base.md).
{% endhint %}

1. Open the **Vartheme\_bs5 theme** page template and expand **Footer** in the **Layers** panel.
2. From the **Library**, **drag** a **Webform** block into the same column as the **Social media menu**, dropping it **under** that menu.
3. Select the webform block and, in the **Settings** panel, set **Webform** → **Newsletter Subscribe** (optionally show a title such as *Subscribe to Our Newsletter*).
4. Click **Publish.**

![The Webform Block Setting: Newsletter Subscribe](https://410909369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcuWLZ87gvtX5vA2YGD%2Fuploads%2Fgit-blob-ff86ebcde90a7cdf24a3c8274a6958353c1f7127%2FCanvas%20Header%20Footer%20-%20Webform%20Settings.png?alt=media\&token=948b2eb3-ff99-4860-b660-647f96098cab)

![The Newsletter Webform Under the Social Media Links in the Footer](https://410909369-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzBcuWLZ87gvtX5vA2YGD%2Fuploads%2Fgit-blob-1dcd7c62765946e2e4b59e5a4ca9583ee0432f2a%2FCanvas%20Header%20Footer%20-%20Example%20Newsletter%20Webform.png?alt=media\&token=f77327c5-beb2-4eeb-8d0d-8924d263b441)

## Publishing Your Changes

Drupal Canvas saves your work as an auto-saved draft while you edit. The changes are not live until you publish them.

1. Click **Review changes** in the top bar to see what changed.
2. Click **Publish** to make the new header and footer live on every page that uses the page template.

{% hint style="warning" %}
Because the header and footer belong to the page template, publishing updates them on **every** page that uses the **Vartheme\_bs5 theme** page template. Review your changes before publishing.
{% endhint %}

## Related Documentation

{% content-ref url="/pages/kjSr6TCub4OWBwEA3j9Q" %}
[Understanding Vartheme BS5](https://docs.varbase.vardot.com/developers/theme-development-with-varbase/understanding-vartheme-bs5.md)
{% endcontent-ref %}

{% content-ref url="/pages/WGulY4r5D7l3lF271q4s" %}
[Creating Your Own Theme](https://docs.varbase.vardot.com/developers/theme-development-with-varbase/creating-your-own-theme.md)
{% endcontent-ref %}
