Russell,

I think I am starting to get the basic idea of 'extends' for templates.
However, I don't get what I need to do to get my basic example (or your
example for that matter) to generate the page I want to see in my browser.
It doesn't just work the way php would here so I am guessing I need to add a
'view' or do something with 'urls.py' or both but I can't figure out what
that would be since I am not processing anything or sending any information
to the page.

Thanks,

Vincent


On 5/28/07 7:39 PM, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote:

> 
> 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 %-)
> 
> > 

-- 
Vincent R. Nijs
Assistant Professor of Marketing
Kellogg School of Management, Northwestern University
2001 Sheridan Road, Evanston, IL 60208-2001
Phone: +1-847-491-4574 Fax: +1-847-491-2498
E-mail: [EMAIL PROTECTED]
Skype: vincentnijs




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to