Templates and layouts

Use a different header or footer on some pages

Every template uses one layout for its header, its footer and the panels that open over the page, such as the menu on phones. To give some pages another header, such as a landing page without the menu, make a second layout and give it to those templates.

Make the layout

  1. Open your project in Fantasma.
  2. In the icon rail, click the second icon, Layouts.
  3. In the Layouts list, click Default.
  4. In the right sidebar, click Duplicate. A copy named Default Copy opens, with the same header, footer and dialogs.
  5. In the right sidebar, enter a name in Name, such as Landing.
  6. Change its sections the way you want them. In the Standard header, the menu links sit in the group Menu row under Navigation. To drop them, right-click Menu row and select Delete. Later changes to Default don't reach the copy.

Start from an empty layout

To start from an empty layout instead of a copy, click + next to Layouts. A layout named Untitled Layout opens with Template Sections alone, the place where each page's own content goes. You add its sections yourself.

Give the layout to a template

  1. In the icon rail, click the first icon, Templates.
  2. In the Templates list, click the template, such as /about.
  3. In the right sidebar, select the new layout under Layout. The canvas shows the template inside it.

You can also right-click the template in the list and select the layout under Layout. New layout in that menu makes an empty layout and gives it to the template at once.

The menu of the /about template open in the Templates list, with Layout pointing to Default and New layout

Every template can have its own layout, custom templates and error pages included, except a template for a tag, such as #review. A post template for a tag follows the layout of Post, and a page template for a tag follows Page.

The layout's Used by list in the right sidebar shows every template that uses it.

Delete a layout

Select the layout and click Delete layout in the right sidebar, then Delete to confirm. The templates that used it go back to Default. Default cannot be deleted.

A project holds up to 20 layouts, each with up to 20 sections. Your Ghost site gets the new layout when you publish your theme or upload it again.

Was this article helpful?