Re: Simple next and previous index in templates

2007-01-26 Thread [EMAIL PROTECTED]
For what it's worth, I'd suggest getting your javascript out of those links, for graceful degradation: In your javascript, loop through the links, get the href, and use it to know which ones to show and hide. {% for item in site_details.Photos.all %} {{item}} {

Re: Simple next and previous index in templates

2007-01-26 Thread nesh
* AndyB wrote, On 26.01.2007 16:56: > here's what I've got: > > {% for item in site_details.Photos.all %} > > {{item}} > > {% if not forloop.first %} > prevĀ  {{ forloop.counter|add:"-1" }} > {% endif %} > {% if not forloop.last

Simple next and previous index in templates

2007-01-26 Thread AndyB
I'm trying to have a list of images in a doc all hidden in css with next and prev links that unhide and hide to give the appearence of scrolling through. I'm struggling with the Django template system. I know this is putting logic into templates rather than views but it seems odd to move simple l