Stacks API

Come build with us.
Stacks API v6 for Stacks 2.5


  <   Property List Reference


This content is open source. You can edit it and submit a pull request on GitHub.
This page is generated from this file.


© . YourHead Software all rights reserved.

Template Files Dictionary

Overview

All of the template files that your stack uses must be declared in the Info.plist inside the templates array. Each item in the array is a dictionary that defines the name, type, and scope of the template.

Contents

Basic

Reference


File Name — filename

Description

The file name of template. This should be only the name, not the complete path.


Type — type

Description

The type of template. This must be one of: html, css, js, php, or file.


Scope — scope

Description

The scope of the template defines how the template will be added to the page.

HTML Page Scope

Page scoped HTML templates will be place in the <head> tag of the page following the CSS and JS links. This is useful for including links to external CSS and libraries.
Just as in each scoped templates, CSS is included in Edit Mode but Javascript will be disabled. Use the feature sparingly as linking to external resources can slow down page loads

Note: For improved performance disable external CSS links in Edit Mode.

CSS Page Scope

Page scope CSS templates will be added to the pages CSS file and will preceed the each scoped CSS. This allows you to define the base styes once for all stack instances in the page scope and override the styles when necessary in the each scoped templates.

Javascript Page Scope

Page scoped Javascript is included in its own closure separate from the closure for the each scoped Javascript. This allows you to define Javascript functions once for all instances of the stack on the page which will speed up the page and reduce the memory footprint.

PHP Page Scope

Page scoped PHP will be included in the linked php. It will preceed the each scoped PHP.


File templates

Assets are faster than templates

Most files that are exported with the page should be added as an asset. Assets are included without any sort of template processing so there is no performance penalty for adding them.

Templates are processed

There are times when it is helpful to inject properties from your stack into included files. You can add a template with the type of file for this purpse. File templates can be any text file (UTF-8).

Not for edit mode

Because template files may be very slow to process, they will not be processed for edit mode. Only HTML and CSS templates are processed for edit mode.

© . YourHead Software all rights reserved.