[Petal] Multiple conditions?

William McKee william at knowmad.com
Mon Mar 10 08:27:28 GMT 2003


On Sun, Mar 09, 2003 at 10:03:13AM -0800, Ronald Hayden wrote:
> Perhaps the website has more?  I've seen several mentions of it on this 
> list, but I've only looked at the docs on CPAN.  Come to think of it, 
> where is the website?  I've never noticed it in many Google searches.  
> (Hmm, trying to find a Petal homepage is currently crashing Google!)

Well, the website is up and coming. I have a page of examples that I
use to test new releases of Petal that I'll try to get loaded up this
week. The url used to <http://petal.mkdoc.org>; however, things have
apparently changed with the host company because that address is
bringing up a webarch.net homepage. Perhaps we'll hear more about this
development later. Be sure to read the POD for Petal::Doc::Petales. That
has lots of examples in it.


> >Note that there is currently no trivial way of doing ORs...
> 
> Oops, and that's actually what I turned out to need!  Well consider it 
> a feature request.  In general I don't like putting much logic (beyond 
> condition and repeat) in the templates, but I'm finding that without an 
> OR, I have to have the code be more involved than I'd like.

I agree although have so far been content to create condition
hierarchies in my templates since it's only been 2 options. This point
brings up in my mind the question of how is it done in TAL. I think that
they have a method of invoking Python directly but so far Jean-Michel
has avoided making Perl's interpreter available, a decision with which I
generally agree. However, it would be nice to have a solution to the OR
dilemma.


> If anyone has suggestions for a (simple!) solution, I'd love to hear 
> them!

Oftentime, Jean-Michel suggests creating a custom modifier. This
technique is explained in more detail in the Petales doc I suggested
above.


Good luck and let us know what you end up doing,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com



More information about the Petal mailing list