[Zope] two different trees in one dtml method

Martijn Pieters mj@antraciet.nl
Tue, 22 Jun 1999 09:09:44 +0200


At 03:01 22/06/99 , Clarence T. Pate wrote:
>Hey all,
>I am trying to create two different trees in one DTML Method, and I am
>failing miserably.  The first tree works fine, but the second gives an
>error message:
>
>'tuple' object has no attribute 'append'.
>
>If I comment out the first tree, the second tree will work.
>
>
>
>I have a folder called trouble.  Inside the folder are two folders -
>answers and questions.  Inside of the index_html for trouble I have the
>following:
>
><!--#tree answers-->
>  <SPAN CLASS="tree">
>     <!--#var title-->
>  </SPAN>
><!--#/tree-->
><!--#tree questions-->
>  <SPAN CLASS="tree">
>     <!--#var title-->
>  </SPAN>
><!--#/tree-->
>
>It is not necessary for me to be able to do this, but any help would be
>appreciated.

That is because AFAIK you can't use two trees on one page. They use the 
same variable names, and will conflict with each other. You could try and 
combine the two trees by doing something like this:

<!--#tree answers_and_questions sort=objecttype-->
  <SPAN CLASS="tree">
     <!--#var title-->
  </SPAN>
<!--#/tree-->

where answers_and_questions is a Folder object containing the answers and 
the questions objects, and each answer and question have a property called 
'objecttype', one with value 'answer', and one with the value 'question'. 
Set these values on the answers and questions objects as well.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------