On Tue, 2009-04-07 at 03:04 -0700, Chris Dew wrote:
> Here's a newbie question:
> 
> Is there a way of rendering (a single block of?) a Django template,
> without it loading in it's parent template(s).
> 
> My purpose is to use a single template to render both a component of a
> page as an html snippet (for ajax), as well as the whole page (for non-
> javascript clients).  DRY.

Not directly, no. However, there's an alternate way to think about the
problem. Make the fragment you're talking about a complete template on
its own. Then that fragment can be included into the larger template via
the "include" template tag. So, instead of pulling a small piece out of
a larger template, treat the smaller piece as a standalone and then
inject that *into* the larger template.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to