First, thank you to everyone that has made Kid possible. We're using Kid 0.9.

The problem we're having is that arguments are not being 'passed through' to child templates that specify a parent layout via py:layout. Example:

layout.kid:
---
<html xmlns:py="http://purl.org/kid/ns#";>
  <body>
    layout template locals: ${str(dir())}
    <br/>
    ${local_content()}
  </body>
</html>
---

child.kid:
---
<html py:layout="'layout.kid'" xmlns:py="http://purl.org/kid/ns#";>
    <content py:def="local_content()" py:strip="True">
        Child template locals: ${str(dir())}
    </content>
</html>
---

Running 'kid child.kid testarg=foo' results in 'testarg' being in the locals from the layout template, but that argument is missing from the child template locals.

Now, it's understood that the function created by the py:def in the child template is completely different function with its own locals, etc, but it's pretty unintuitive that it doesn't inherit the locals of the layout template that is calling that function. I've poked around a little at trying to define and then call local_content() with the layout template's locals dict (expanded into kwargs), with little success.

We can certainly inject into the layout template what local_content() is generating using py:match and adding an appropriate anchor tag in the layout template. However, given the provisional nature of py:match, being able to readily use py:def in its place would be preferable at this time.

Thoughts?

Thanks,

Chas Emerick
Founder, Snowtide Informatics Systems
Enterprise-class PDF content extraction

[EMAIL PROTECTED]
http://snowtide.com




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
kid-template-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to