I could be wrong, but I think the problem he's having is having to
specify the menu variable in the context for every view, not the
template end of it...

To fix that, you will want to check out context processors:
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext

On Jul 28, 10:30 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Why not have a base template that contains the menu variable ( I put
> mine in a session variable accessible to the templates named menu ),
> then have all of your other templates extend from that template?
>
> In base.html:
>
> <head>your header code</head>
> <body>
>         {% block menu %}
>         {{ menu }}
>         {% endblock%}
>
>         {% block content %}{% endblock %}
> </body>
>
> Then in your other templates:
> {% extends "base.html" %}
>
> {% block content %}
> content for your html specific page here
> {% endblock %}
>
> On Jul 28, 1:13 pm, Eloff <[EMAIL PROTECTED]> wrote:
>
> > I've got a nav.html template that does the menu on every page. The
> > only trouble is I have to store the menu items in a global variable
> > and pass it to the page template in every view. Is there any way to
> > make a view for the nav.html template (which is included in all the
> > page templates)? I imagine it could be done with SSI but I don't want
> > to go that route unless I have no other option.
>
> > Thanks,
> > -Dan


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