0

How do I display thumbnails for my item list....also is it possible to display just a specific thumbnail or a random thumbnail? So far I have this in my template:

{% for p in item.images.all %}
   {{ p.get_thumbnail.url }}
{% endfor %}
Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162
Stephen
  • 5,959
  • 10
  • 33
  • 43

2 Answers2

1

To display the image, you'll at least need to use an <img> tag:

 <img src="{{ p.thumbnail_image.url }}" alt="{{ p.name }}">
miku
  • 181,842
  • 47
  • 306
  • 310
0

Just got an answer to the problem:

{% for p in item.images.all|slice:"4" %}
Stephen
  • 5,959
  • 10
  • 33
  • 43