On 5/29/07, vince <[EMAIL PROTECTED]> wrote: > > What would i need to do exactly to > get the following to work? > > {% include("design/index_nav.html") %} > Welcome to the home page > {% include("design/footer.html") %}
The following would work: {% include "design/index_nav.html" %} Welcome to the home page {% include "design/footer.html" %} But this probably isn't the best way to solve the problem. A better approach is to use blocks and extend. design/base.html: ----- {% block nav %} Some navigation content {% endblock %} {% block content %} {% endblock %} {% block footer %} Some footer content {% endblock %} design/home.html ----- {% extends "design/base.html" %} {% block content %} Welcome to the home page {% endblock %} That way, you set up a single page template (base.html), with a block where you want various significant pieces of content (main content, sidebar, etc), and then on your actual content page, you replace specific blocks. This way, you ensure that every page on your site is using a common basic template. If you need to, you can even layer ther extensions (e.g., base -> content -> home) to add complexity to your basic templates in layers. See [1] for more details on how template inheritance works. [1] http://www.djangoproject.com/documentation/templates/#template-inheritance Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---