Jevgenijs Rogovs wrote:
> Hello!
> 
> I'm new to Trac plugin development, so I started with EggCookingTutorial
> (http://trac-hacks.org/wiki/EggCookingTutorial). The third part of the
> tutorial (
> http://trac-hacks.org/wiki/EggCookingTutorial/AdvancedEggCooking2)
> explains how to use a template, but there's one thing I just don't get:
> how to insert some piece of data from my python code into the template??

You may want to read Clearsilver's doc for the template language itself.
Concerning the Trac-plugin part, your IRequestHandler componant's
'process_request' method is supposed to fill in the request.hdf
attribute with the needed data structure (made of dicts, lists, strings
and numbers).

> The example template contains the following piece of code, which seems
> to do the trick: <?cs var:chrome.href ?>
> But when I try to define some member variable in the python class and
> display it in a similar manner, e.g. (for modified example) <?cs
> var:UserbaseModule.MyVariable ?>, nothing appears in the resulting
> output. Why? 

Because Clearsilver doesn't understand Python - it's a
language-independant library (coded in C AFAIK).

> What am I doing wrong? And how to do this right?

cf above. You can also browse Trac's source code (and/or existing
plugins source code) for concrete usage examples.

HTH
-- 
bruno desthuilliers
développeur
[EMAIL PROTECTED]
http://www.modulix.com
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev

Reply via email to