Dermot wrote:
> I have used $ with reference to
> http://template-toolkit.org/docs/manual/Variables.html#section_Variable_Interpolation
> but if I mis-reading the docs please let me know.


You are misreading them. Use:

[% subs.makeLink(lid=>lightbox.lid, perpage=>p) %]

However, if you need this passed in list form, you'll need to do something 
different. TT takes named parameters and puts them in a hashref that it passes 
at the end of the parameters for a routine. So technically the above is the 
same as doing:
[% subs.makeLink( {lid=>lightbox.lid, perpage=>p } ) %]

Here is info on named parameters in TT:
http://docs.huihoo.com/template-toolkit/Manual/Variables.html#Parameters_and_Return_Values


So you may need to use this instead if your subroutine is not expecting a 
hashref:
[% subs.makeLink('lid', lightbox.lid, 'perpage', p) %]


You should really only use $ in places where TT is expecting a string:
*) inside a string. ie. "Here $test".

*) Using PROCESS/INSERT, because they normally consider their file parameter a 
string. [% PROCESS filename %] vs [% PROCESS $get_filename_from_me %]

*) in a hash you want to get the key to access from a varaible. [% hash.key %] 
vs [% hash.$get_key_from_me %]

-- Josh

_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to