[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Appendix C: Zope Page Templates Reference

nobody@nowhere.com nobody@nowhere.com
Tue, 10 Sep 2002 02:34:14 -0400

A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixC.stx#3-52


      Inserting HTML/XML::

        <p tal:content="structure here/getStory">marked <b>up</b>
        content goes here.</p>

        % Anonymous User - May 23, 2002 12:43 pm:
         This snippet is unclear unless we know what getStory
         returns.  Is it HTML?  Be clear.  

         Also, what would happen if you said "structure" but
         only text were returned, or vice-versa?

        % fdrake - May 24, 2002 4:41 pm:
         getStory() is expected to return HTML (or XML if you're using XML instead).
         Nested TAL markup will be interpreted.

         If it returns plain text it needs to be valid when parsed as an HTML fragment,
         so it depends on whether the < or & characters are included.

        % Anonymous User - Sep. 10, 2002 2:34 am:
         A problem I can find no documentation on related to this, 
         is how can you access variables defined in a page template,
         in another page template called to be the content of a tag?
         For example, say the getStory above is actually a page template,
         and you modify the call like this:

         <p tal:define="myvar string:whatever"
            tal:content="structure here/getStory">marked <b>up</b>
               content goes here.</p>

         Now how can you access myvar from within getStory?