Understanding AnQiCMS template data structure

AnQiCMS's template adopts syntax similar to Django, with its core advantage being the ease of retrieving data from the backend and rendering it on the frontend. When we use something liketagListSuch a label to obtain the label of the document returns an array or slice containing multiple 'label objects'. Each 'label object' itself may containTitle(Label Name),Link(Tag link) and other fields.

For example, through{% tagList tags %}Such tags, we gettagsThe variable is not a simple string array, but a multiple of likeTagThis structure array. If we try to perform certain operations on it directly, we may not get the results we want.

To clearly demonstrate this, we usually usefora loop to iterate over these tags, like this:

{# 假设我们正在一个文档详情页,获取当前文档的标签 #}
{% tagList tags with itemId=archive.Id limit="10" %}
    {% for item in tags %}
        <a href="{{item.Link}}">{{item.Title}}</a>
    {% endfor %}
{% endtagList %}

This code will output the link and title of each tag separately, but they are scattered HTML elements. Our goal is to connect{{item.Title}}these strings together.

Usejointhe filter implementation