From: Zev Blut Date: 2004-06-22T11:37:08+09:00 Subject: Re: Enabling/disabling HTML with Amrita Hello, On Tue, 22 Jun 2004 06:33:14 +0900, Eric Schwartz wrote: > I know with Amrita, if you pass nil as the data for a template > element, it doesn't get printed. What I'm interested in is in > conditional container elements, such as or , that print > their templated content when enabled. See my test below: > > emschwar@wilson:/tmp$ cat bah.templ > > > >
/>
Notice that cell2 is a child of row2. Now try using this data hash: #!/usr/bin/ruby require 'amrita/template' data3 = { :cell1 => "Cell 1", :row2 => { :cell2 => "Cell 2" } } template = Amrita::TemplateFile.new("bah.templ") template.expand(STDOUT, data3) > Obviously, what I'm looking for in the second case is something like > > > >
Cell 1
Cell 2
The result of data3 should be what you want. I hope this makes sense. Best, Zev