Amrita Question - using a() with nested elements

Hello all,

Just downloaded Amrita and playing with it - looks really cool so far!

I have a couple of static (i.e. no dynamic data) web sites that share a
common structure (framesets and the like) and I thought I’d have a go at
specifying the structure using Amrita, and then provide variable content
for the sites. I am having some difficulty applying the information
provided in the docs to a specific problem:

Given the following template:

I am having trouble seeing how I provide data for this template.

I originally started with:

data = {
:frameSet => a(:cols => “,1,”),
:blankFrame => a(:src => “blank.html”),
:dataFrame => a(:src => “data.html”),
}

This doesn’t work (the blankFrame and dataFrame items are not replaced)
because amrita seems to be looking for children of :frameSet to find
:blankFrame and :dataFrame.

Now I can see how I could do it, if I embedded some of the template into
the data (e.g):

data = {
:frameSet => { a(:cols => “,1,”) { "<frame … " }
}
}

… but this seems to violate the intention of amrita (i.e. to separate
the html from the application data).

Am I missing anything here or (more likely) am I using it wrong?

Thanks for any help you can give

Martin

···


Martin Hart Tel: +44 (0) 1582 618468
Arnclan Fax: +44 (0) 1582 619596
Union Street, E-mail: martin@zsdfherg.com
Dunstable, Beds LU6 1EX

I think this is what you want .

···

At Thu, 19 Dec 2002 21:35:41 +0900, Martin Hart wrote:

Hello all,

Just downloaded Amrita and playing with it - looks really cool so far!

I have a couple of static (i.e. no dynamic data) web sites that share a
common structure (framesets and the like) and I thought I’d have a go at
specifying the structure using Amrita, and then provide variable content
for the sites. I am having some difficulty applying the information
provided in the docs to a specific problem:


require ‘amrita/template’
include Amrita

t = TemplateText.new <<END

END

data = {
:frameSet => a(:cols => “,1,”) do
{
:blankFrame => a(:src => “blank.html”),
:dataFrame => a(:src => “data.html”)
}
end
}

t.expand(STDOUT, data)

I’ve got a very simillar question at amrita-users. ( What a Syncronicity!)

The description is here.

http://www.walrus-ruby.org/amrita/amrita-users/msg00015.html


Taku Nakajima
http://www.walrus-ruby.org/amrita/