On 10/05/06 17:34, seemant wrote: > Hi All, > > So, on the right column of http://www.djangoproject.com/weblog/ that > page, we see an index of archived posts, going back 12 months or so. > > And so I thought I'd check out the template: > http://code.djangoproject.com/browser/djangoproject.com/django_website/templates/base_weblog.html > > but the template (and adrian's commit message) seem to imply that that > list is generated manually. Is there no construct in Django that will > auto-gen a link list like that? >
I needed just that so I wrote a template tag for it [1]. Usage is like this: {% load archivedates %} {% get_archive_dates news.Entry pub_date as archive_dates %} {% if archive_dates %} <h2>News Archiv</h2> <ul class="linklist"> {% for archive in archive_dates %} <li><a href="/news/{{ archive|strftime:"%Y/%b/"|lower }}">{{ archive|date:"F Y" }}</a></li> {% endfor %} </ul> <hr /> {% endif %} [1] http://www.c-area.ch/code/django/templatetags/archivedates.py Hope that helps Steven --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---