> The thing is, in my sidebar I want to display all the categories. This
> sidebar is the same for every view. How do I create the variables
> needed for this recurring sidebar? So that in every view I can
> generate a list of all categories in the database?

It sounds like you're interested in one of two things:

1) template inheritance:  you can define a base template that has
the skeleton of your site (headers, and the above-mentioned
side-bar with categories), and then other templates can use this
as the base for their content.

http://www.djangoproject.com/documentation/templates/#template-inheritance

2) template tags:  these abstract away chunks of rendering logic
that can be reused.

http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-tags

Most likely, you want #1 for your purposes.  Just make sure that
the variables used to render each your templates are put in the
context that's passed to the template.

-tim





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