0
我试图从一个文件列表contenttype中显示在无序列表中的所有文件的列表。但我一直无法获得文件位置{{ record.file }}
的工作。我通过发布{{ record.title }}
来临时解决这个问题,其中{{ record.file }}
应该是。下面螺栓cms文件路径文件
<ul>
{% set filerecord = record.file() %}
{% if record.file is not empty %}
{% for record in filerecord %}
<li><i class="fa fa-file-pdf-o"></i><a href="{{ paths.files }}{{ record.file }}" title="Download">{{ record.title }}</a></li>
{% endfor %}
{% endif %}
</ul>
这段代码确实得到了文件名,但只适用于将contentType文件,而不是文件清单,因为它是一个数组。
{% for key,value in record.values if key in ['templatefields'] %}
<span><i class="fa fa-calendar"></i>Oplevering |</span>
<span>{{ record.starts_at }} /</span>
<span>{{ record.ends_at }} |</span>
{% set filerecord = record.file() %}
{% if filerecord is not empty %}<span><i class="fa fa-file-pdf-o"></i><a href="{{ paths.files }}{{ record.file }}" title="Download de folder">Download de folder</a></span>{% endif %}
{% endfor %}