From olaf at buwen.de Thu Sep 1 09:48:56 2005 From: olaf at buwen.de (Olaf Buwen) Date: Thu Sep 1 09:49:12 2005 Subject: [Petal] How do I use selected/checked ? In-Reply-To: <389e9736fd2421653d3e621a13fb173c@mastersofbranding.com> References: <337E0616-A691-4977-A5CF-96F8A1FDF06D@mastersofbranding.com> <20050831075524.GB4176@webarchitects.co.uk> <1125502219.1174.1.camel@wsmithbox> <389e9736fd2421653d3e621a13fb173c@mastersofbranding.com> Message-ID: <4316C078.3050407@buwen.de> This template: with this code: ... print $template->process( options => [ {lang => "foo", title => "Foobar"}, {lang => "bar", title => "Barbar", selected => 'selected'}, {lang => "baz", title => "Bazbar"}, ] ); gives this output: It is not in the docs, but AFAIK it is part of the TAL spec that an attribute is not set when the appropriate entry is missing. I hope this helps Olaf From josh at narins.net Thu Sep 1 16:14:21 2005 From: josh at narins.net (Josh Narins) Date: Thu Sep 1 16:14:27 2005 Subject: [Petal] Tree Tactics In-Reply-To: <20050826195710.GB463@narins.net> References: <20050826195710.GB463@narins.net> Message-ID: <20050901151420.GA1918@narins.net> > I've got a tree, with arbitrary depth, like.. > > { > text => 'This is the top', > sort => [5,3,7], > children => > 3 => { > text => 'This should be second', > sort => [4,6], > children { > 4 => { text=>'a leaf',}, > 4 => { text=>'another leaf',}, > }, > 5 => ... > 7 => ... > } > } > > I hope you get the idea. > > How do I get this to work in Petal? > > I figure I should be able to do it with a single template. > > myself.xml > ========== > > > > > > >
> This is dummy text > > >
> > What should that repeat be? I can do it with "each:" but then I don't > get any order. I want the order to be that as described in the sort > array ref. > > How does anyone handle recursive trees? No one has recursive tips? From chris at webarchitects.co.uk Thu Sep 1 16:19:12 2005 From: chris at webarchitects.co.uk (Chris Croome) Date: Thu Sep 1 16:19:24 2005 Subject: [Petal] Tree Tactics In-Reply-To: <20050901151420.GA1918@narins.net> References: <20050826195710.GB463@narins.net> <20050901151420.GA1918@narins.net> Message-ID: <20050901151912.GA20317@webarchitects.co.uk> Hi On Thu 01-Sep-2005 at 11:14:21AM -0400, Josh Narins wrote: > > > > I figure I should be able to do it with a single template. > > No one has recursive tips? With MKDoc, for things like the sitemap, which is made up of nested