[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Navigation Templates and Run Mode


From: "B10m" <suppressed>
> * Brett Sanger <suppressed> [2005-10-19 15:04:42-0400]
> [Highlighting runmode navigation in template]
> > So I tried to move to include a Nav template.  For that to work,
> > however, I need to make my run_mode visible to my template, which bugs
> > me in some way.  The template shouldn't care.  But then, the template
> > has to know the OTHER run modes to send you there, so I guess it's not a
> > big deal, but it does bug me.
>
> I don't see the big problem here. The template is supposed to know
> the runmode, for then it can make decissions of where to send you
> next. I might be missing something here ...

You or Brett can tell me if I'm misunderstanding something. I make the lack
of a run-mode indicate a default run mode. This way my *site* navigation
template doesn't have to know anything about run modes. Each area of the
site is a cgiapp object; if it's called without a run mode, the setup method
defaults to an appropriate runmode/method.

Within an area of the site (which is equivalent to a distinct cgiapp object)
there usually are sub-areas which are equivalent to run modes for a single
cgiapp object. The sub areas are depicted in a sub-navigation pane. I don't
put the run mode in the sub navigation. Instead, each link has ?subarea=new
(or ?subarea=archived, or ?subarea=upcoming). It is the setup method for a
cgiapp object that translates this to a "rm=<num>" pair of values so they
relate to a method in the cgiapp object.

I don't know if this is considered good or bad by cgiapp users. But,
personally I liked it because 1) it replaces the cryptic "rm=" with
something more informative if the user happens to look at the URL. 2) It
keeps the run mode values out of the templates by abstracting their actual
value into something logical. And, 3) it eliminates the use of an rm (or
subarea) parameter for default (initial entry) views.

Of course, my setup method looks like hell. A lot of if/else blocks to set
the run mode based upon the presense/absense of a "subarea" parameter, and
its value.

I don't know if that gets to what bugs Brett?

Mark


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.