Fundamentals

Check if asset exists

SmartVisu provides a Twig function to check if an asset (image, widget HTML, etc.) exists. That is especially important for widgets that might be imported from the dropins folder.
Example
{% if asset_exists('stateengine.html') %}
{% import "widgets/stateengine.html" as stateengine %}
{% endif %}

Array-Form

Some widgets may have an array as a parameter. Use [ ... , ... ] to define it. An array is only needed if you have more than one object.
Example
... ['bath_plot1', 'bath_plot2', 'bath_plot3'] ... -> 3 items as an array
... 'bath_plot1' ... -> only one item, no array needed

Duration-Format

Some widgets require a parameter for duration or period. This is specified with the following letters:
s (second), i (minute), h (hour), d (day), w (week), m (month, 30 days), y (year, 365 days)
Example
... '10i 30s' ... -> 10 minutes + 30 seconds
... '2w' ... -> 2 weeks

More Information

More information can be found on the wiki pages.
Please contribute there if you like to share your knowledge. We'll integrate the contents into this inline documentation later.

Widgets

Design

Misc