Tags and Usage Methods of Templates

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 Tagssystem
Usage method: {% system variable_name with name="field_name" %}
  • Contact Information Tagcontact
Usage method: {% contact variable_name with name="field_name" %}
  • Universal TDK Tagtdk
Usage method: {% tdk variable name with name="field name" %}
  • Navigation List TagnavList
Usage method: {% navList navs %}...{% endnavList %}
  • Breadcrumbs Navigation Tagbreadcrumb
  • Category List TagcategoryList
  • Category Details TagcategoryDetail
Usage: {% categoryDetail with name="Variable Name" %}
  • Single Page List TagpageList
Usage Method: {% pageList pages %}...{% endpageList %}
  • Single Page Detail TabpageDetail
Usage method: {% pageDetail with name="Variable Name" %}
  • Document list tagarchiveList
  • Document detail tagarchiveDetail
Usage method: {% archiveDetail with name="variable name" %}
  • Previous document tagprevArchive
Usage method: {% prevArchive prev %}...{% endprevArchive %}
  • Next document tagnextArchive
Usage method: {% nextArchive next %}...{% endnextArchive %}
  • Related document tagsarchiveList
  • Document parameter tagsarchiveParams
  • Document parameter filter tagsarchiveFilters
  • Document Tag List TagstagList
  • Tag Details TagstagDetail
Usage method: {% tagDetail with name="Variable Name" %}
  • Tag Document List TagstagDataList
  • Comment List TagcommentList
  • Message Form Tagguestbook
Usage Method: {% guestbook fields %}...{% endguestbook %}
  • Friendship Link TaglinkList
Usage method: {% linkList friendLinks %}...{% endlinkList %}
  • Page Tagpagination
  • if logic judgment tagif else endif
  • for loop to traverse tagsfor empty endfor
Usage method: {% for item in archives %}...{% empty %}...{% endfor %}
  • Timestamp Formatting TagstampToDate
  • Define variable assignment labelwith
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 Tagstags
Usage: include, extends, macro, lorem
  • More Filtersfilters
Usage method: {{obj|filter__name:param}}