On 8/18/06, Andrew <[EMAIL PROTECTED]> wrote: > My first thought was to use {% include %}, but after playing with it, > it seems it's not just a simple cut-and-paste tag -- no matter where I > place the include tag in my document( in the <head> or <body>), it > semi-magically takes code in the <head> and <body> tags of the > included template and places it the corresponding places of the > including template -- although sometimes it will place script tags into > the wrong place (e.g. I have a script in the <head> of included > template A, it now shows up in the <body> of template B)
> Is the merging algorithm of {% include %} documented anywhere? Yes, it's a simple textual merge. The included template is evaluated and replaces the {% include %} tag. The include tag is not HTML-aware, so everything in the included template will be included, even the HEAD. It sounds to me like you want the same fragment of HTML to appear on two different pages - the main page and the module page. If that's the case, then you will need 3 templates files. - fragment.html - main.html, which includes fragment.html - module.html, which also includes fragment.html fragment.html is just a fragment of HTML - just that part that needs to go on both pages. It should not have HTML, HEAD or BODY tags. Make sense? If not let us know and I'm sure you'll get a fuller explanation. Alan -- Alan Green What's that Django template doing there? Off with it's <head>. [EMAIL PROTECTED] - http://bright-green.com --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---