Are there gotchas with these?  I've got some really simple code which
should work, to produce a sidebar with categories and pages.

First I tried this but the ifchanged page.category didn't work:

        <ul>
        {% for page in pages %}
          <!-- {{ page.name }} | {{page.category }} -->
          {% ifchanged page.category %}
            {% if not forloop.first %}
            </ul>
          </li>
            {% endif %}
          <li>{{ page.category }}
            <ul>
          {% endifchanged %}
              {% ifnotequal page.name "Home" %}
              <li><a href="{% url views.viewPage page.name %}">
{{page.name|escape}}</a></li>
              {% endifnotequal %}
          {% if forloop.last %}
            {% if is_admin %}
              <li><a href="{% url views.addPage %}">Add a page</a></
li>
            {% endif %}
            </ul>
          </li>
          {% endif %}
        {% endfor %}
        </ul>
      </ul>

Then I tried this but the ifequals doesn't work!

        <ul>
        {% for category in categories %}
          {% ifchanged %}
            {% if not forloop.first %}
            </ul>
          </li>
            {% endif %}
          <li>{{ category.name }}
            <ul>
          {% endifchanged %}
              {% for page in pages %}
                {% ifequal page.category category.name %}
                   {% ifnotequal page.name "Home" %}
              <li><a href="{% url views.viewPage page.name %}">
{{page.name|escape}}</a></li>
                   {% endifnotequal %}
                {% else %}
          <!-- {{ page.name }} |{{ page.category }}|
{{ category.name }}-->
                {% endifequal %}
                {% if forloop.last %}
            </ul>
          </li>
                {% endif %}
              {% endfor %}
        {% endfor %}
        </ul>
      </ul>

I know the values are right because I examined the page source in the
comments.  ifequals works elsewhere.

Please help me somebody... any workarounds or clues anything...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to