Proposal: Build complex-navigation helper

5 views
Skip to first unread message

M Rotch

unread,
Jun 3, 2010, 7:41:07 PM6/3/10
to Django developers
Building a site with more than 50 views tends to require some sort of
sub-sub-page type of system in order to make for easy navigation. For
instance:

/eggs-view/
/eggs-view/sub-view/
/eggs-view/sub-view/sub-sub-view/

/spam-view/
/spam-view/spam-sub-view/
/spam-view/spam-sub-view/spam-sub-sub-view/

/foo-view/
/foo-view/foo-sub-view/
/foo-view/foo-sub-view/foo-sub-sub-view/

Currently, in order to maintain software with this sort of
architecture one can build a tabbed based navigation. The complexity
comes in when you want "sub-view" level tabs to show up only when
you're on "eggs-view", and "sub-sub-view" level tabs to show up when
you're on "sub-view", and so on. This can be done by creating a master
template, inheriting it at each level, and overriding a {% BLOCK MENU
%}. This is OK for small sites, but when you've got 50+ views to
maintain, it means you have sub-sub folders of templates all for the
sake of overriding a single block.

It would be such a relief if a DRY way of configuring a navigation
object existed that allowed for you to build, say, a dictionary of
view-confs with sub-view-confs, etc.

The closest thing I've come across as a solution so far is
http://code.google.com/p/django-nav/

I wonder if anyone in the official D-crew has come up with any ideas
that maybe just need implementing, or perhaps there are others with
this difficulty that would like to see something like this in the
trunk.

Dj Gilcrease

unread,
Jun 3, 2010, 8:23:52 PM6/3/10
to django-d...@googlegroups.com
On Thu, Jun 3, 2010 at 7:41 PM, M Rotch <plane...@gmail.com> wrote:
> The closest thing I've come across as a solution so far is
> http://code.google.com/p/django-nav/

As the developer of django-nav it is nice to hear it is closest to a
solution you have found, but often closest isnt enough, and I am not
sure I understand what you are describing you need to do to get
sub-sub-tabs working. Here is how I do it in the sites I maintain that
go 3 levels deep for tabs

base.html -> has main tabs
/app/app_base.html -> extends base.html and has sub-tabs
/app/view1.html -> extends app_base.html
/app/view2.html -> extends app_base.html
...
/app/sub_app_base.html -> extends app_base.html and has sub-sub-tabs
/app/sub_view1.html -> extends sub_app_base.html
/app/sub_view2.html -> extends sub_app_base.html
...

Reply all
Reply to author
Forward
0 new messages