You can put a snippet in a separate template file and {% include %} it twice from the same pages specific template. I frequently do this in a for loop for rendering more complex list items on more than one page, so I have one place to define how a list item looks. But including it directly twice works as well. I frequently do that to render my next-previous page chooser both before and after a list. The only issue is that for it to render something different, it needs some different variable in the context (for me, the loop variable), but you can set context variables if need be. If it's to look the same both times (or you only need css differences) then just include it twice.
On Fri, Apr 2, 2010 at 1:36 PM, Matt E <mmelliott...@gmail.com> wrote: > Is there a way to use a template twice on the same page? We don't want > to have to create a duplicate template just for a different variable. > Thanks for the help > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.