I\'m trying to pass an array to my template with a simple tag. I created my module under app/templatetags/pages_navigation.py and in my opinion the code should be alright:>
In new Django 1.4, you could use Assignment Tags https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags-assignment-tags
from django import template
register = template.Library()
@register.assignment_tag
def get_links():
return (('Events', '/'),) + tuple((p.title, '/'+p.url) for p in Page.objects.all())
{# in template #}
{% get_links as links %}
You could port it to your Django version if you like it.
Furthermore, if your page URLs is like /?page=2, you could try django-pagination http://pypi.python.org/pypi/django-pagination