Django templates: accessing the previous and the following element of the list
You can create an external tag which does that but django templating system which was build to be lightweight has no such feature in for loops.
I am rather new to django templates and have an impression that I have not understood some basics.
I have a list of elements and I need to render an element of the list based on conditions against the the previous and the next elements (in case the following or the previous elements are hidden, I need to mark the current element as border element). 
How can I reference the previous and the following elements within a for loop in Django templates?