I am also in a very similar situation to you, Will (nice name btw).

I have a 2 level hierarchy in an ajax-y fashion.. It's easier to show
than describe: http://beta.willboyce.com/blog (if it fails to load and
you care enough, try again in a few mins - "beta" ;-))

In order to mark the current section/subsection I wrote all my views
to expect an "extra_context" parameter (meaning generic views would
work), which contains "section" and "subsection" vars - these are
added by middleware (process_view()) - and the header is build in a
base.html using pretty simple templating:

        <ul id="nav">
            {% for s in sections %}
            <h2{% ifequal section s.slug %} class="selected"{%
endifequal %}><a href="{{ s.get_absolute_url }}">{{ s.title }}</a></
h2>
            {% endfor %}
        </ul>

I have a nav app which has a Section model and some ajax views, which
I could see no way to do but hard code (if section=x and
subsection=y... hardcoded sections/subsections)

I don't know - it works but it doesn't feel like the most elegant
solution. Especially with the middleware/adding context to views (this
is my first django project btw!)

Hope this helped.. And any comments would be more than welcome :-)

Regards, Will Boyce

On Jun 3, 8:35 pm, Will <[EMAIL PROTECTED]> wrote:
> Thanks for your replies, chaps.
>
> I need to mull this over, but I think I see what you're getting at
> (using template inheritance). I've realised the breadcrumbs should be
> easy (use Super to add to the breadcrumb section I suppose).
> The bit I don't see is how you get the info about section navigation
> into the context - is is hard-coded into the view? This is what I'd
> like to avoid.
>
> Cheers
>
> Will
--~--~---------~--~----~------------~-------~--~----~
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