J Scott Smith

Set a default template for pages in Statamic

Notes - August 16th, 2014

Add a default template to your YAML

Setting a default template for all pages using a specific fieldset is really easy. But, since I’ve forgotten this simple task many times, I thought I’d write it down. To do so just add the following lines to the your fieldset_name.yaml file:

  type: hidden
  default: template_name

The type: hidden just ensures field will not be visible in the control panel.

Change the default template of a folder

You can also change the default template for all pages within a folder with the folder’s page.md. Just add the _default_folder_template: field:

title: My Blog
_default_folder_template: blog-detail


blog comments powered by Disqus