The template files are marked with labels similar to Django template engine, while variables are defined using double braces, such as{{变量}}
. Tags such as conditional judgment, loop control, etc. are defined using single curly braces and percent signs, and need to be ended with end tags. The tags appear in pairs, such as{% if archive.Id == 10 %}这是文档ID为10的文档{% endif %}
.
There are 38 common labels built into the system:
- System Settings Tags
system
How to use: {% system variable name with name="field name" %}
- Contact Tags
contact
How to use: {% contact variable name with name="field name" %}
- Universal TDK Tag
tdk
How to use: {% tdk variable name with name="field name" %}
- Navigation List Tag
navList
How to use: {% navList navs %}...{% endnavList %}
- Breadcrumb navigation tags
breadcrumb
How to use: {% breadcrumb crumbs with index="Homepage" title=true %}...{% endbreadcrumb %}
- Classification list tags
categoryList
How to use: {% categoryList categories with type="1" parentId="0" %}...{% endcategoryList %}
- Category Details Tags
categoryDetail
How to use: {% categoryDetail with name="Variable Name" %}
- Single page list tag
pageList
How to use: {% pageList pages %}...{% endpageList %}
- Single page details tag
pageDetail
How to use: {% pageDetail with name="Variable Name" %}
- Document list tags
archiveList
Usage method: {% archiveList Variable name with categoryId="1" moduleId=1 order="id desc|views desc" type="page|list" %}...{% endarchiveList %}
- Document Details Tags
archiveDetail
How to use: {% archiveDetail with name="Variable Name" %}
- Previous document tag
prevArchive
How to use: {% prevArchive prev %}...{% endprevArchive %}
- Next document tags
nextArchive
How to use: {% nextArchive next %}...{% endnextArchive %}
- Related Document Tags
archiveList
Use method, refer to the document list tag: {% archiveList archiveRelations with type="related" %}...{% endarchiveList %}
- Document parameter tags
archiveParams
{% archiveParams params with sorted=true %}...{% endarchiveParams %}
- Document parameter filter tags
archiveFilters
How to use: {% archiveFilters params with moduleId=1 allText="all" %}...{% endarchiveFilters %}
- Document Tag List Tag
tagList
How to use: {% tagList tags with type="1" limit="10" %}...{% endtagList %}
- Tag details tag
tagDetail
How to use: {% tagDetail with name="Variable Name" %}
- Tag Document List Tag
tagDataList
How to use: {% tagDataList archives with tagId="1" %}...{% endtagDataList %}
- Comment list tag
commentList
How to use: {% commentList comments with itemType="archive" itemId="1" type="page" %}...{% endcommentList %}
- Message form tags
guestbook
How to use: {% guestbook fields %}...{% endguestbook %}
- Friendly link tags
linkList
How to use: {% linkList friendLinks %}...{% endlinkList %}
- Pagination Tags
pagination
How to use: {% pagination pages with show="5" %}...{% endpagination %}
- if logical judgment tag
if else endif
How to use: {% if condition %} ... {% elif other conditions %} ... {% else %} ... {% endif %}
- for loop traversal tags
for empty endfor
How to use: {% for item in archives %}...{% empty %}...{% endfor %}
- Format timestamp tags
stampToDate
How to use: {{stampToDate(timestamp, "format")}}. The time stamp is 10 bits, such as 1609470335, the format is a format supported by Golang.
- Define variable assignment tags
with
Usage method: {% with title="This is the title declared for the header" keywords="This is the keywords declared for the header" %} %}Title: {{title}}, keywords: {{keywords}}
- Other auxiliary tags
tags
How to use: include, extends, macro, lorem
- More filters
filters
How to use: {{obj|filter__name:param}}