The use of template files is similar to the tag syntax of Django template engine, and variables are defined using double curly braces, such as{{变量}}
Condition judgment, loop control, and other tags are defined using single curly braces and percent signs, and they must be terminated with an end tag, appearing in pairs, such as{% if archive.Id == 10 %}这是文档ID为10的文档{% endif %}
.
There are 38 commonly used tags built into the system:
- System Settings Tags
system
Usage method: {% system variable_name with name="field_name" %}
- Contact Information Tag
contact
Usage method: {% contact variable_name with name="field_name" %}
- Universal TDK Tag
tdk
Usage method: {% tdk variable name with name="field name" %}
- Navigation List Tag
navList
Usage method: {% navList navs %}...{% endnavList %}
- Breadcrumbs Navigation Tag
breadcrumb
- Category List Tag
categoryList
- Category Details Tag
categoryDetail
Usage: {% categoryDetail with name="Variable Name" %}
- Single Page List Tag
pageList
Usage Method: {% pageList pages %}...{% endpageList %}
- Single Page Detail Tab
pageDetail
Usage method: {% pageDetail with name="Variable Name" %}
- Document list tag
archiveList
- Document detail tag
archiveDetail
Usage method: {% archiveDetail with name="variable name" %}
- Previous document tag
prevArchive
Usage method: {% prevArchive prev %}...{% endprevArchive %}
- Next document tag
nextArchive
Usage method: {% nextArchive next %}...{% endnextArchive %}
- Related document tags
archiveList
- Document parameter tags
archiveParams
- Document parameter filter tags
archiveFilters
- Document Tag List Tags
tagList
- Tag Details Tags
tagDetail
Usage method: {% tagDetail with name="Variable Name" %}
- Tag Document List Tags
tagDataList
- Comment List Tag
commentList
- Message Form Tag
guestbook
Usage Method: {% guestbook fields %}...{% endguestbook %}
- Friendship Link Tag
linkList
Usage method: {% linkList friendLinks %}...{% endlinkList %}
- Page Tag
pagination
- if logic judgment tag
if else endif
- for loop to traverse tags
for empty endfor
Usage method: {% for item in archives %}...{% empty %}...{% endfor %}
- Timestamp Formatting Tag
stampToDate
- Define variable assignment label
with
Usage method: {% with title="This is the title declared for the header" keywords="These are the keywords declared for the header" %} %} Title: {{title}}, Keywords: {{keywords}}
- Other Auxiliary Tags
tags
Usage: include, extends, macro, lorem
- More Filters
filters
Usage method: {{obj|filter__name:param}}