[Helma-user] some observations with nested macros

tobias.schaefer at orf.at tobias.schaefer at orf.at
Tue Apr 24 16:08:13 CEST 2007


hi there

made some observations with nested macros; maybe someone could explain:

1. why do i get the macro error?

var s = createSkin('<% param.foo default=<% param.bar %> %>');
renderSkin(s, {foo: 1, bar: 2});
=> 1
renderSkin(s, {foo: null, bar: 2});
=> [Macro error in param.foo: java.lang.Integer]

2. why isn't "bar" titleized, but "foo" is always?

var s = createSkin('<% param.foo | titleize %>');
renderSkin(s, {foo: "foo", bar: "bar"});
=> Foo
var s = createSkin('<% param.foo default=<% param.bar %> | titleize %>');
renderSkin(s, {foo: null, bar: "bar"});
=> bar
// even worse:
var s = createSkin('<% param.foo prefix=<% param.bar %> | titleize %>');
renderSkin(s, {foo: "foo", bar: "bar"});
=> barFoo

(i think the filter should be applied after prefix / default have been applied.)

ciao,
tobi


More information about the Helma-user mailing list