I have a template (file2.tt) calling a BLOCK (file1blk) within a sub-template ( file1.tt). The file1blk builds a hash data structure. When file2 calls file1.tt/file1blk, it seems like I cannot access the data structure itself. Text returns seem to work.
 
[%# -------- file1.tt ---- %]
// some code
[% USE MyPlugin %]
[% BLOCK file1blk %]
[% MyH.text1 = "Sample text1" %]
[% MyH.text2 = "Sample text2" %]
[% IF CALLED %]
  [% MyPlugin.modifythehash(MyH) %]
  [% RETURN %]
[% ELSE %]
 // do some more processing
[% END %]
[% END # end block %]
[%# ---- End of file file1.tt ----- #]
 
Another file file2.tt, calls file1.tt
[% xx = INCLUDE file1.tt/file1blk CALLED =1 %]
[% xx %]
 
[% USE dumper %]
[% dumper.dump(xx) %]
This just says that 'xx' is a 'HASH(address)'.
 
Any idea why this is happening? In MyPlugin.modifythehash, I take the reference and add some more parameters. If I print MyH before the RETURN, that seems to print the hash correctly. The issue is that I could'nt use this hash reference from a higher level template.
 
Thanks
Subbu
 

Reply via email to