Using a template twice on the same page

2010-04-02 Thread Matt E
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

Re: Using a template twice on the same page

2010-04-02 Thread orokusaki
Hey Matt, If you're trying to use the same template twice in the same request, you might want to reconsider a few things about the design, such as: You may want to use an include instead, or you may want to use a loop inside your template. Either way, here's one way to achieve that if I'm simply m

Re: Using a template twice on the same page

2010-04-02 Thread Bill Freeman
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