Zero One Documentation
Theme demo
  • Overview
  • Terms & Guidelines
  • Guide
    • Installation
      • Local environment
      • Server
      • Default language!
      • Multilanguage website
      • Config options
      • Folder structure
      • htaccess
      • Updating
      • PHP Composer
    • Administration panel
      • Translating panel
    • Site options
      • SEO options
      • Multi-language
    • Theme styling
      • Less/CSS setup
      • Changing Less variables
      • app.less file
      • Customizing elements
      • Helpful classes
    • Page types
      • Page options
    • Blog
      • Comments
      • Article
    • Work (Portfolio)
      • Project page
    • Shop
      • Snipcart
    • Layout Builder
      • Column Options block
      • Subgrid block
      • Card block
      • Text (Writer) block
      • Custom Heading block
      • Custom List block
      • Typed Text block
      • Quote block
      • Button block
      • › 25 more blocks
    • Form Builder (Premium)
    • OLD Page Builder deprecation
    • Tricks
      • Using icons in the content
      • Kirbytext link tag to button
      • Tricks with image classes
      • Adding Google Fonts
      • Custom icons
      • Cookie notice/banner
    • Theme extending
      • Page Transitions (Swup)
      • Contact form extending
      • Self-hosted fonts
      • Adding new templates
      • Adding new Content block (Layout Builder)
    • GDPR
  • More
  • Support
  • Hire us
  • Changelog
  • Credits
  • Affiliate
Powered by GitBook
On this page

Was this helpful?

  1. Guide
  2. Theme extending

Adding new templates

How to add new templates?

PreviousSelf-hosted fontsNextAdding new Content block (Layout Builder)

Last updated 1 year ago

Was this helpful?

Please, if you haven’t first read this section

Because Zero One is a theme made as a plugin, you can override every plugin file with the same name and file in the site/theme folder. But it must be in the same folder structure as in the plugin.

Let’s say you want to add a new template called “books”:

  • Create a template first

    • Add a new site/theme/blueprints/pages/books.yml file for the page blueprint

    • Then add a new site/theme/templates/books.php file for the template code

  • Include the template in the main pages (main dashboard, highest level pages)

    • Copy site/plugins/zero-one/blueprints/tabs/site-content.yml file

    • To site/theme/blueprints/tabs/ folder (create blueprints and tabs folders, of course), so you get site/theme/blueprints/tabs/site-content.yml file

    • Open the file with the code editor and add the “books” template name in the allowed templates for both Draft templates and Published templates

    • And that’s it! Test it and you will see your new template.

  • Include the template to subpages:

    • Copy site/plugins/zero-one/blueprints/sections/page-draft.yml file

    • To site/theme/blueprints/sections/ folder (create folders), to get site/theme/blueprints/sections/page-draft.yml file

    • Open that new file and add the “books” template to the allowed templates list

    • Do the same with site/plugins/zero-one/blueprints/sections/page-published.yml file (copy it to, and change it like you did with page-draft.yml file)

When you follow this approach, even when you update Zero One to the new version, your changes will be untouched.

For the page template, we suggest you check:

  • site/plugins/zero-one/blueprints/pages/default.yml

  • And site/plugins/zero-one/templates/default.php

And maybe use that template as your base for further extension/customization.

https://www.one.thezero.club/guide/theme-extending