- Theme Engine
- Design Principles
- Templates
- EVML Reference
- Output
- Comments
- Operators
- Statements and Declarations
- Built-in Functions
- Built-in Objects
- Account
- Address
- Array
- Boolean
- Branch
- Cart
- CartLine
- Category
- CategoryCollection
- CategoryFilter
- CategoryFilterCollection
- CategoryFilterOption
- CategorySearch
- Collection
- Color
- Contact
- Currency
- Date
- Discount
- Dom
- Event
- EventCollection
- EventSlot
- Image
- Layout
- Locale
- Money
- Number
- Object
- Page
- PageCollection
- PageSearch
- PageSharer
- Pagination
- Postage
- Price
- PriceDiscount
- Product
- ProductCollection
- ProductCustomisation
- ProductDownload
- ProductMedia
- ProductMediaFrame
- ProductPrice
- ProductSearch
- ProductSpecification
- ProductSpecificationValue
- ProductVariation
- ProductVariationOption
- RecentlyViewed
- RegExp
- Request
- Review
- ReviewCollection
- Search
- SearchCollection
- SearchResult
- String
- Tag
- Template
- Url
- Website
- EV Tags
- CSS Pre-processor
- Ajax API
Template
The template object provides access to properties/settings defined within the Template Config file at runtime.
Instantiation
Template objects are automatically supplied at runtime, but can be instantiated manually if necessary.
<?ev
var default_template = new Template('page/index');
?>
Construct parameters | |
---|---|
reference |
Type String The reference must be a valid template reference, which is made up of controller/identifier.
|
Properties | |
---|---|
assets |
Type Array Containing String asset identifiers available to pages with this template. Assets and asset identifiers are defined within the Template Config file i.e. you have full control over what assets are and what they can be used for. |
children |
By default this property has a Boolean value of true, meaning that pages with this template may contain any sub-page with the same controller. If set to false pages with this template may not have sub-pages. This property can contain an Array of template identifiers with the same controller. Note that children identifiers must have the same controller, so a "page" controller may not have a child document that is a "category". The value for this property is set within your Template Config file. This property is available for the following controllers:
Note: category controller only currently supports a true value. |
id |
Type String The identifier string for the current template. |
path |
Type String
The raw path as set within the config/templates.json file.
|
perpage |
Type Number Default value is zero - view all child pages. When greater than zero pages with this template will support pagination and filtering by tag, date, or author of child pages. This property is available for the following controllers:
|
settings |
Type Object Contains properties defined with a "template" scope within the Template Config file. The best way to visualise this is with an excerpt from config/templates.json settings file for a page with properties.
...and then the resulting setting object:
This property is currently available to the following controllers:
|
sort |
Type String Contains the sort order for the current Page template. The sort string is comprised of column:direction. Available settings can be found on the Template Config page. This property is currently available to the following controllers:
Note that category sort order is managed within Evance itself per category and you do not need to set it in your Template Config. |
tags |
Type Array Contains an Array of String identifiers representing each TagType supported by the template. This property is currently available to the following controllers:
|
title |
Type String The name of the template. |