Templates and layouts

Let writers choose a template in Ghost

A custom template is a second design for posts and pages that writers pick for each post in Ghost Admin, such as a long-read layout for features. A post uses it only after a writer selects it, while a template for a slug or a tag applies by itself.

Add the template

  1. Open your project in Fantasma.
  2. In the left sidebar, click + next to Templates. The Add Template menu opens.
  3. Under Variants, the first group of the menu, click Custom template. A small dialog opens, Add Custom Template, with one field.
  4. In the field, enter a name, such as longform. Fantasma writes it in small letters, with hyphens for spaces.
  5. Click the arrow button at the end of the field. The template appears in the list under the heading Custom and opens on the canvas.
The right sidebar of the Longform custom template, with Template name longform and File custom-longform.hbs

The new template starts as a copy of your current Post template, with all its sections.

To start from a ready design instead, click Custom, the last item of the Add Template menu, not the Custom template item under Variants. It adds a template named Narrow, with narrow text and no sidebar. The item shows only while your project has no custom template.

Choose the template in Ghost

  1. Publish your theme to Ghost, or download it and upload it in Ghost Admin. Publish your theme to Ghost describes both ways.
  2. In Ghost Admin, open the post or page.
  3. Open the post settings.
  4. In the template field, select your template.
  5. Save or update the post in Ghost.

Ghost shows the template field only when the active theme has at least one custom template, so it appears after step 1.

Rename or remove it

Select the template in the list. In the right sidebar, enter a new name in Template name. The file name changes with it.

To remove the template, click Delete template at the bottom of the right sidebar.

Which template Ghost uses for each page explains how a custom template ranks against templates for a slug or a tag.

Was this article helpful?