Maple Engine
Last Updated: 2023-11-04 06:02:43
other content such as headers, footers and menus should be placed. Includes are fragments of HTML code that produce headers, footers and menus.
Note: Includes are often referred to as partials and mean the same thing.
When assigning layouts or importing includes, it's important to understand system and plugin paths as well as partials. It you're accustomed to Mvc architecture then you already know what template partials are and how they are store on disk.
Fliddo websites use Mvc architecture to bridge the gab between our developers, you and your developers. This standardization makes it easier for our developers to introduce updates to templates and your developers to understand and interpret those changes. Since both teams are using the same constructs, development becomes streamlined.
For Example, based on the previous example, "website/partials/fragment" and "website/plugin/partials/fragment"
Unlike layouts, partials can reside anywhere you want but it's best practice to save these files within the partials path of your website or plugin.
Note: save partials outside the scope of the partial path is now deprecated and will be phasing out.
Includes are defined as { inc [ TEMPLATE ] } where TEMPLATE is the name of your template file. The template path is required as well as the initial forward slash. This means that a plugin partial is also defined the same way, not requiring plugin identification.
To assign import a template fragment in your webpage is written as follows
{ inc /partials/header.maple }
For Example, system path and plugin path can be viewed as "website/" and "website/plugin/"
Layouts can only reside in either the system of plugin starting point. Layouts cannot be access outside of this scope.
For Example, based on the previous example, "website/layout" and "website/plugin/layout"
Layouts are defined as { layout [ TEMPLATE ] } where TEMPLATE is the name of your layout. The layouts template path does not include path elements besides the initial forward slash. This means that a plugin layout is also defined the same way, not requiring the plugin path.
To assign a layout to your webpage is written as follows
{ layout /layout-application.maple }