#Substitution, Conditioning, and Looping in the Template should be in the Jinja2 standard. For more tutorials, refer to http://jinja.pocoo.org/docs/2.10/.
Points to Remember
Always enclose the commands within {% %} for "if," and "for," and "while" conditional statements
Always enclose the variables inside {{ }} for substitution
Sample Template Configuration
Example 1: Create an Empty List, add values to the List, and DO a simple ‘For Loop’
# Declaring a string variable to store value from Runtime or user. The default (“”) function will make the variable empty string till the USER input
{% set myinput = Runtime.interface_list | default(“”) %}
# Converting User Input to a list using the Split function
{% set mylist = myinput .split(",") %}
#Doing for Loop or Looping of Each Item
{% for each_interface in mylist %}
<command prompt="#">int {{each_interface}}</command>
<command prompt="#">shutdown</command>
# for requires endfor to close the section
{% endfor %}
Example 2: Conditions (if case elif Case and else case)