Maple Engine

Last Updated: 2023-11-04 06:02:43
Maple is a template language developed by Fliddo. It's provides an syntactical interface to interact with datasets
within HTML templates.  The language includes traditional blocks, variables, conditions and loops but also offers an
interface for APIs and functions.

Note: Maple is the template engine used for you Fliddo website but it can also be used as a standalone engine for
external programming projects.


The designer plugin supports a subset of maple syntax and more support is being added.  Its not absolutely crucial to
understand its syntax unless you are doing custom programming with the source code in which case an understanding of
maple is required.
There are two types of variables, they are either standard or a collection.  A standard variable contains a regular string value accessed by its name to be printed or used to conditional statements. A collection is a variable containing multiple values usually related to one another and referenced by keys, typically used in loops.
      
Variables are defined as { [ VARIABLE ] } where VARIABLE is the name of a variable.  To access its value is written as { myVariable } so your full template may look something like this.
   
<div>{ myVariable }</div>
    
A collection and it's keys, often referred to as a record-set, are accessed differently and requires the indication of a key name.  This is not to be confused with lists which we'll get to soon.  Keys are indicated through brackets and optional quotes enclosing the key name.
    
For example, a variable representing an account may have first and last name variables.  These values can be accessed as myAccount['FirstName'] or myAccount['LastName'].  You can use single, double or no quotes so myAccount['FirstName'] is the same as myAccount["FirstName"] and myAccount[FirstName]. Your full template may look something like this.
    
<div>{ myAccount[FirstName] }</div>
<div>{ myAccount[LastName] }</div>
      
A list is a group of collections in the form of an array.  This means a variable can contain more than one record-set and are only accessible through iterators such as loops.
    
Note: Maple is transitioning to dot notation for collections meaning the previous examples can be written as myAccount.FirstName and myAccount.LastName respectively.
Your Fliddo website comes with default variables loaded on every page request and are called system variables. This is a list and what they mean
    
DomainUrl
Your FQDN domain name with the protocol, commonly used to construct URL paths.
       
DomainIdentifier
Your FQDN domain name without the protocol, commonly used to construct URL paths.
           
TargetLocation
A country code ( 2 characters ) representing your location. For example, US.
           
PrimaryLanguage
A language code ( 2 character ) representing the language of your website content.  For example, En
           
CurrencyCode
A currency code ( 3 character ) representing the currency of your website.  E.g USD
           
SiteTheme
The active HTML/CSS theme on your website, commonly used to construct URL paths.  The default theme is "default"
       
ScriptDirection
The text direction of your content and is related to your website language.
ltr, left-to-right text direction
rtl, right to left text direction
       
ComponentUrl
The active plugin URL path, commonly used to construct URL paths.  For example, /shop
           
Note: Plugins have SEO options which allow the base path to be changed. For example, the /shop path can be changed to /store.  This variable will contain the alternative path if defined.
         
Assets
The public path to your asset files through a CDN.  For example, http://assets.[ your domain ]
           
Essentials
The public path to your asset files without a CDN.  For example, http://www.[ your domain ]
       
Note: The protocol for Assets and Essentials is adjusted based on protocol used to access the webpage.
Was this page helpful?