[英]Get total amount of items in for loop
<div class="imageCounter">
{% for item in page.blogpage_images.all %}
{{ forloop.counter }} of {{ forloop.counter }}
{% endfor %}
</div>
of {{ forloop.counter }}
的部分是我想在可能的情況下顯示列表中的項目數的部分嗎?
只顯示博客頁面圖像的計數:
{% for item in page.blogpage_images.all %}
{{ forloop.counter }} of {{ page.blogpage_images.all.count }}
{% endfor %}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.