Re: [PHP Template] Recursive hide behavior

[email protected] (Monte Ohrt) Fri, 03 Mar 2000 10:22:08 -0600
Newsgroups php.template
Organization ispi
Message-ID <[email protected]>
Monte Ohrt wrote:
> 
> Andrei Zmievski wrote:
> >
> > On Wed, 01 Mar 2000, Dan Libby wrote:
> > > From a syntax perspective, 3 & 4 should be identical, so long as both have unique
> > > ids.  1 & 2 are nice to have, but not strictly necessary, since all
> > > variables/sections could be explicitly listed.  For completeness, none should also
> > > be an option, even though it is the default.  (HTML usually works that way)
> > >
> > > So I would see the syntax as looking like:
> > >
> > > autohide="all" or
> > > autohide="sections" or
> > > autohide="vars" or
> > > autohide="$section1" or
> > > autohide="$section1,$var1" or
> > > autohide="sections,$var1" or
> > > autohide="vars,$section1"
> >
> > Well, I don't think we should put $ in front of sections... They are not
> > really variables. We'd have to do something like:
> >
> > autohide=#vars,section1
> >
> > But #vars is not really a variable. Hmm, maybe
> >
> > autohide=<variables>/<sections>, some examples:
> >
> > autohide=all
> > autohide=vars/section1
> > autohide=$var1,$var2/sections
> >
> > Or use ':' instead of '/', and use '/' for referring to section
> > variables like $section1/foo. Sort of like a 'path' to a variable.
> >
> > > An alternative syntax that may be easier to parse is to have multiple autohide
> > > statements, eg:
> > >
> > > {{section:foo autohide="section1" autohide="$var1"}}
> >
> > I thought about this, but then what if you have autohide="$var1"
> > autohide="all"? Ambiguity land.
> >
> > BTW, I was thinking we'd use " only for constant strings, not to
> > delimiter attribute values.
> >
> > -Andrei
> >
> > "Later in this talk, I intend to define
> >  the universe and give three examples." -- Larry Wall
> >
> 
> I've been trying some different situations, and I think we can live with
> this subset of functionality:
> 
> autohide=none
> autohide=all
> autohide=any
> autohide=vars
> autohide=sections


We already have an ambiguity problem. What if you want to hide when all
variables are empty, or any section is empty?

We could split this up into two separate attributes like so:

hideonvars=none
hideonvars=all
hideonvars=any

hideonsections=none
hideonsections=all
hideonsections=any


Are these attribute names ok? Anyways, this idea keeps the sytax simple
and consistant.

The default might be (the most commonly wanted behavior):

hideonvars=any
hideonsections=all

Monte