On Thursday, June 7, 2001, at 05:02 PM, Ian Bicking wrote:

> Donovan Preston <[EMAIL PROTECTED]> wrote:
>> - You can access methods or data members of this page from your TAL 
>> like
>> this:
>>      <p tal:content="python:page.getContent()">Dummydata</p>
>> Where getContent is a function on your page object.
>
> Now, tal has some sort of path syntax, based more closely on Zope
> internals, right?  So are you just using the python: escape for all
> your values?

Yes, this is true. However, as seen in my example I posted, TAL has a 
concept of local and global variables set within one interpretation 
session. So occasionally you will see something like <p 
tal:content="someVariableSetPreviously"></p>.

As a matter of fact, I had originally written a WebKitEngine for 
processing TAL that placed all of the page's member variables and 
functions into TAL's local namespace. So instead of saying <p 
tal:content="python:page.myFunction(5)"></p> you could say <p 
tal:content="myFunction(5)"></p>. However, this involved crawling the 
page's inheritance hierarchy looking for variables and functions to 
insert into the namespace, and I decided it was more important to stick 
to the TAL syntax than it was to save typing python:page.

I really encourage people to download TAL and try out my implementation 
of TALPage. It's surprisingly easy to use and very powerful.

Donovan

_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to