From: Alex Twisleton-Wykeham-F. <al...@fi...> - 2006-03-07 10:01:21
|
On Tue 7 March 2006 09:48, Holger King wrote: <snip> > is it even possible to access plugged in WebContext-Tools like URLTool > within a "templet" directive like > > >#templet $counter { > > #set $digit = $digit + 1 > > #if ($digit < 10) { > > [$digit < 10] > > $URL.getRequestURL()?counter=$digit Yes it is possible to access variables from the main context. You use a syntax like so (I've also fixed typos in previous copy paste):- #set $outsidevariable = "finished!" #templet $counter { #set $digit = $digit + 1 #if ($digit < 10) { [$digit < 10] #eval $Self using { "digit": $digit } } #else { [$OuterVars.outsidevariable] } } #eval $counter using { "digit": 0 } gives:- [1 < 10] [2 < 10] [3 < 10] [4 < 10] [5 < 10] [6 < 10] [7 < 10] [8 < 10] [9 < 10] [finished!] For more docs see here:- http://www.webmacro.org/TempletDirective Alex |