views:

168

answers:

2

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 %}
+1  A: 

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

 <img src="{{ p.thumbnail_image.url }}" alt="{{ p.name }}">
The MYYN
thanks...I knew something was wrong with my code.
Stephen
BTW...how do can I get four random pictures?
Stephen
A: 

Just got an answer to the problem:

{% for p in item.images.all|slice:"4" %}
Stephen