Hi,
I'm seeing some strange behavior with my template files (in use with
Webware) and wanted to see if any of you have seen the same thing.
I have a complex set of pages where this particular problem is
happening, but I've distilled it down to a few simple templates in
this example and was able to reproduce the behavior.
In this example, I have one master template, '_master.tmpl' that
defines three sections/placeholders for a document and provides the
initial values via #def directives.
Then, I have a sample page, '_pageA.tmpl' that #extends the master
template and re-defines the second section with a #block directive.
Here's the problem: every once in a while, sections one and three
may or not actually be sections one and three. Sometimes one will
be three and vice versa, but never do they actually swap places,
i.e. it never happens that I get Three/Two/One, just sometimes
Three/Two/Three and One/Two/One. In my actual set of pages, I'm
define seven placeholders in the master template and only the
placeholders that weren't over-ridden in the sub-pages exhibit this
behavior.
Below is the code for each of the 5 files mentioned above (separated
with a line of dashes). Am I not properly using the various
directives, or is there a better way to define default values for
certain placeholders?
I'm currently using Python 2.2, Webware 0.7b2 and Cheetah 0.9.11
(cvs as of 3/25) -- and using cheetah-compile to create .py servlets.
Thanks!
--Tracy
NOTE: I have created a test that doesn't use Webware and just
#includes the files directly, calling the script like %python
_pageA.py -- and this problem *doesn't* happen.
----------
## _master.tmpl
#def $sectionOne
#include $request.serverSideContextPath + '/_sectionOne.tmpl'
#end def
#def $sectionTwo
#include $request.serverSideContextPath + '/_sectionTwo.tmpl'
#end def
#def $sectionThree
#include $request.serverSideContextPath + '/_sectionThree.tmpl'
#end def
<HTML><BODY>
$sectionOne
<P><HR></P>
$sectionTwo
<P><HR></P>
$sectionThree
</BODY></HTML>
----------
## _pageA.tmpl
#from _master import _master
#extends _master
#block sectionTwo
<P>This is my custom content for section Two.</P>
#end block
----------
## _sectionOne.tmpl
<P>The default section One.</P>
----------
## _sectionTwo.tmpl
<P>The default section Two.</P>
----------
## _sectionThree.tmpl
<P>The default section Three.</P>
----------
--
Tracy S. Ruggles -- [EMAIL PROTECTED] -- 888/999-2674 x TR
OutputLinks -- http://www.outputlinks.com
"Your Output Industry Portal"
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss