I have a template as such:
---------------------------------------------------------------
|
TITLE                                            |
|--------------------------------------------------------------|
|                            |             |
|                        |
|      Item 1           | IMG 1  |  IMG 2  |        Item 2     |
|---------------------|----------|-----------|------------------|
|                            |             |
|                        |
|      Item 3           | IMG 3  |  IMG 4  |        Item 4     |
|---------------------|----------|-----------|------------------|
|                            |             |
|                        |
|      Item 5           | IMG 5  |  IMG 6  |        Item 6     |
|---------------------|----------|-----------|------------------|


Now as the very simple diagram shows above the html will differ for
item 1 and item 2, but will be the same for item 1, 3, 5.  And also be
the same for item 2, 4 and 6.


Currently I am using a standard loop:

        {% if paginator.object_list %}

{% for menuitem in paginator.object_list %}
<p>
    {{ menuitem.name }}<br />         &pound;{{ menuitem.price }}<br /
>
    {% for offer in menuitem.offer_set.all %}
      {% ifequal offer.expired "No" %}
      {% ifequal offer.active "Yes" %}
        <del>{{ menuitem.price }}</del>   {{ offer.offerprice }}   <a
href="{{ offer.get_absolute_url }}">** Special Offer **</a><br />
      {% else %}
      {% endifequal %}
      {% endifequal %}
      </p>
    {% endfor %}
    {{ menuitem.description }}<br />
    {% if menuitem.vegetarian %}
      Suitable for vegetarians<br />
    {% endif %}
<br /> <br />

{% endfor %}
        {% else %}

        <p>No menu items have been added to this menu yet, please
check back soon.</p>

        {% endif %}


How would I adapt this so that odd items (first, 3rd etc) use 1 piece
of html, but even items use another?

Many thanks,
Duncan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to