Hello all,

I have some problems when trying to load only part of the page (<body>
for example) in AJAX calls without duplicating page structure in
multiple templates.

I have my base.html (in reality the structure is much more complex,
but that doesn't matter for this example):

<html>
<head>...</head>
<body>
<div id="content">
{%block content%}{%endblock%}
</div>
<div id="links">
{%block links%}{%endblock%}
</div>
</body>
</html>

For some AJAX calls, I need to reload the body of the page. That is, I
need to get the structure of the body to be similar as is in the
base.html. The problem is I can't find a way to do this without
duplicating the structure of the page in the AJAX template.

I have tried to put the <body> part inside another template,
base_body.html, which I could extend in my AJAX calls. I tried to
include (or ssi) that in base.html. But this way I cannot override the
content and links blocks when extending directly the base.html. I
cannot directly use the base.html when doing AJAX call for the body,
because this way I will get the <html> and <head> elements again
loaded in my AJAX call.

Am I missing some obvious or non-obvious way to accomplish this?

I am using django-trunk from a few weeks ago.

Anssi Kääriäinen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to