Templates must be stored within the following file path of your project: marketplace_builder/views/layouts/templates/
and must be .liquid
file type.
This is an example Template generated by Siteglide. Below, we'll list available YML parameters, and body content.
metadata
id
- Used by UI to reference Templates. Must be unique (required)
name
- Template name shown in UI (required)
type
- Used to define where the Template shows in UI. Either page or email (required)
file_type
- Set as 'template' (required)
last_edit
- timestamp of last edit - shown in UI
use_design_system
- true/false - used to determine whether or not we automatically add assets from the Siteglide Design System Module.
physical_file_path
- Files should be stored in a location relative to their ID. If your ID is 1, then the physical_file_path would be views/layouts/templates/1.liquid
This Liquid is not displayed as editable code in the Siteglide Admin and is automatically added. However, if you're using CLI, you should make sure to include it manually if missing.
Constants makes certain variables available in the Page and passes others up to the Page Template e.g. SEO. It should sit at the very top of most Page Templates.
Page Templates are used for organising the repeatable content you will want to display on multiple pages, including Headers and Footers
Page Templates are used to easily and consistently apply the same global content to pages, such as: Headers, Footers, Global Stylesheets and Analytics Tracking Scripts.
Page content will be outputted where the liquid tag {{content_for_layout}}
is located within your Template.
Here is how a generic Page Template file should be structured:
While editing a Page, you can assign a Template using the Page Template drop down and then clicking Save.
Note: Toolbox functionality will soon be added to the templates section of Admin, allowing you to easily select elements to add to the page.
Page Templates on Siteglide are called Layouts on platformOS: https://documentation.platformos.com/developer-guide/pages/layouts