Odd, but I was struggling with this same problem at about the time you were
posting this note. 

The manual is sort of offhand about the fact that the META directive can
only deal with "simple" data.  However, you can pass in a filename, so you
could put your hash in an external doc. This is how I managed to get some
Javascript code into the header part of a page wrapper:

#in the template
[% META
        title   = 'Title'
        page_id   = "demo"
        additional_js   = "demo_js.tt2" 
%]

#in the wrapper
[%  IF ( template.additional_js );
            myfilename = template.additional_js;
            INSERT "site/$myfilename";
      END;
 %]          

HTH

Bruce


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robin Szemeti
Sent: Tuesday, January 14, 1997 7:23 AM
To: [EMAIL PROTECTED]
Subject: [Templates] META failure to understand where I'm going wrong ...


OK, Im going worng somewhere ...

I have a 'wrapper' template called mian.tt2 that lays out the basic page ..

and sets the title and stuff ... under Apache::Template I have:

   TT2Process          main.tt2 
   TT2PreProcess       config 

and the wrapper I have [% PROCESS $template %] and in each template I have 
somting like [% META title ='FooBar' %] so far so good.

Then .. I needed to add suuport for different locales ...  I include an 
appriate <lang>.tt2 filel that populates a hash called lang with local 
specific key/val pairs ...


[% META title = lang.foobar.title %]

results in an unexpected token (lang) error ... I'm guessing that its all to

do with the conext that META is processed in .. using string literals seems 
to work fine, trying anything that looks remotley like a variable seems to 
result in a painful death. 

clues welcome.

-- 
RapidCut CNC Technology

CNC Plasma Cutter
http://www.rapidcut.co.uk/

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates



_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to