Re: How do I reference functions from another template?
Saul Jaspan <[email protected]>
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the response.
> If they are in the same directory
If they were in the same directory but deeper in the directory tree
would that change anything? ie.
dir1/auctionmethods.html
#def foo($arg)
<b>$arg</b>
#end def foo
dir1/caller.html
#include "dir1/auctionmethods.html"
$foo('bidegg')
What about if they are in different directorys like the original
example I gave, would that change anything? ie.
dir1/dir2/auctionmethods.html
#def foo($arg)
<b>$arg</b>
#end def foo
dir1/caller.html
#include "dir1/dir2/auctionmethods.html"
$foo('bidegg')
Thanks,
Saul
On Tue, May 5, 2009 at 2:18 AM, <[email protected]> wrote:
> If they are in the same directory
> auctionmethods.html
> #def foo($arg)
> <b>$arg</b>
> #end def foo
> nwew.html
> #include "auctionmethods.html"
> $foo('bidegg')
>
> On Mon, May 4, 2009 at 6:34 PM, Saul Jaspan <[email protected]> wrote:
>>
>> Lets say I have a template, dir1/dir2/dir3/foo.tmpl:
>>
>> #def FooFunct($param1, $param2):
>> Stuff here
>> #end def
>>
>> and another template where I want to call FooFunct, dir1/base.tmpl:
>>
>> #include "dir1/dir2/dir3/foo.tmpl"
>> #* Want to call $FooFunct("1", "2") *#
>>
>> I assume I need to import foo in some way but don't know where it
>> lives (I have tried from dir1.dir2.dir3 import foo already ;). Is
>> there a way of doing this without first compiling foo.tmpl?
>>
>> Thanks,
>> Saul
>>
>>
>> ------------------------------------------------------------------------------
>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>> production scanning environment may not be a perfect world - but thanks to
>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
>> i700
>> Series Scanner you'll get full speed at 300 dpi even with all image
>> processing features enabled. http://p.sf.net/sfu/kodak-com
>> _______________________________________________
>> Cheetahtemplate-discuss mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
>
>
>
> --
> Bidegg worlds best auction site
> http://bidegg.com
>
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com