Documentation
Search…
⌃K
Links

Templating techniques for Web-pages

You may use Templating in the following components foe Directual web-page builder:
Cards and Kanban don't require to connect additional Endpoint. custom HTML view operates with the fields of an object directly.

Connecting API-endpoint and turning on the Templating engine

If you want to use data or global variables in your component, you should turn on that feature in the component settings:

Applying the Templating for the component content

Global variables

The same way, that we apply in scenarios
{{GlobalVar.myGlobalVar}}

WebUser fields

{{id}}
{{role}}
{{firstName}}

URL parameters

​URL parameters that we use for subpages may be displayed in components
{{HttpRequest.paramName}}

Objects from API-endpoint. Dealing with the first object – contentHead

If you connect API-endpoint, you can deal with objects it provides.
{{#contentHead}}
{{firstName}} {{lastName}}
Project {{project_id.title}} // here project_id is a link
{{/contentHead}}
​
// the result may look like
Steve Jobs
Project Apple

Objects from API-endpoint. Dealing with a list of objects – content

{{#content}}
- {{firstName}} {{lastName}} launched {{project_id.title}}
{{/content}}
​
// the result may look like (for 2 objects, provided by API-endpoint)
- Steve Jobs launched Apple
- Bill Gates launched Microsoft
The mechanism is similar to the one used for scenarios
{{#arraylink_field}}
- {{title}} {{city}}
{{/arraylink_field}}
​
// the result may look like (for 2 objects in the arrayLink field)
- Apple Cupertino
- Microsoft Seattle

Handling booleans

Similar to the Templating in scenarios
/ shows if is_vip == true
{{#is_vip}}vip{{/is_vip}}
​
// shows if is_vip == false
{{^is_vip}}not vip{{/is_vip}}
You may apply complex HTML for building beautiful custom pages.
​