[Zope] Question about tree tag.

Josef Albert Meile jmeile@hotmail.com
Sun, 2 Dec 2001 20:55:08 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0009_01C17B73.A08F5CD0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi everybody!
I'm trying to figure out how I can set the "order" attribute of the tree =
tag with the value of a variable:
For example:

  <dtml-unless treeOrder>
      <dtml-call "REQUEST.set('treeOrder','title')">
  </dtml-unless>
  <dtml-tree sort=3DtreeOrder>
    <a href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a>
  </dtml-tree>

By doing this, I get the following error:
             Error Type: AttributeError
             Error Value: treeOrder
Same thing happens whenever I try with:
sort=3D"treeOrder"=20
sort=3D&dtml-treeOrder;=20
sort=3D"&dtml-treeOrder;"

Currently I am using this solution, which works, but it isn't clean:
  <dtml-unless treeOrder>
      <dtml-call "REQUEST.set('treeOrder','title')">
  </dtml-unless>
  <dtml-if expr=3D"treeOrder=3D=3D'title'">
    <dtml-tree sort=3D"title">
      <a href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a>
    </dtml-tree>
  <dtml-elif expr=3D"treeOrder=3D=3D'id'">
    <dtml-tree sort=3D"id">
      <a href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a>
    </dtml-tree>
  <dtml-elif expr=3D"treeOrder=3D=3D'user'">
    <dtml-tree sort=3D"user">
      <a href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a>
    </dtml-tree>
  <dtml-elif expr=3D"treeOrder=3D=3D'date'">
    <dtml-tree sort=3D"date">
      <a href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a>
    </dtml-tree>
  </dtml-if>

Does somebody knows how to render this variable?

Thanks in advanced,
Josef.

------=_NextPart_000_0009_01C17B73.A08F5CD0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi everybody!<BR>I'm trying to figure =
out=20
how&nbsp;I can&nbsp;set the "order" attribute of the tree tag with the =
value of=20
a variable:<BR>For example:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-unless =
treeOrder&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;dtml-call=20
"REQUEST.set('treeOrder','title')"&gt;<BR></FONT><FONT face=3DArial =
size=3D2>&nbsp;=20
&lt;/dtml-unless&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-tree=20
sort=3DtreeOrder&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;a =
href=3D"&amp;dtml-absolute_url;"=20
target=3D"previewPanel"&gt;&lt;dtml-var title&gt;&lt;/a&gt;<BR>&nbsp;=20
&lt;/dtml-tree&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>By doing this, I get the following=20
error:</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
Error Type:=20
AttributeError<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;=20
Error Value: treeOrder</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Same thing happens whenever I try=20
with:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial=20
size=3D2>sort=3D"treeOrder"&nbsp;</FONT></FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>sort=3D&amp;dtml-treeOrder;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>sort=3D"&amp;dtml-treeOrder;"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Currently I&nbsp;am using&nbsp;this =
solution, which=20
works,&nbsp;but it isn't clean:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-unless=20
treeOrder&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-call=20
"REQUEST.set('treeOrder','title')"&gt;<BR>&nbsp; =
&lt;/dtml-unless&gt;<BR>&nbsp;=20
&lt;dtml-if expr=3D"treeOrder=3D=3D'title'"&gt;<BR>&nbsp;&nbsp;&nbsp; =
&lt;dtml-tree=20
sort=3D"title"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a=20
href=3D"&amp;dtml-absolute_url;" target=3D"previewPanel"&gt;&lt;dtml-var =

title&gt;&lt;/a&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/dtml-tree&gt;<BR>&nbsp;=20
&lt;dtml-elif expr=3D"treeOrder=3D=3D'id'"&gt;<BR>&nbsp;&nbsp;&nbsp; =
&lt;dtml-tree=20
sort=3D"id"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a=20
href=3D"&amp;dtml-absolute_url;" target=3D"previewPanel"&gt;&lt;dtml-var =

title&gt;&lt;/a&gt;<BR>&nbsp;&nbsp;&nbsp; =
&lt;/dtml-tree&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-elif=20
expr=3D"treeOrder=3D=3D'user'"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;dtml-tree=20
sort=3D"user"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a=20
href=3D"&amp;dtml-absolute_url;" target=3D"previewPanel"&gt;&lt;dtml-var =

title&gt;&lt;/a&gt;<BR>&nbsp;&nbsp;&nbsp; =
&lt;/dtml-tree&gt;</FONT></DIV>
<DIV>&nbsp; &lt;dtml-elif =
expr=3D"treeOrder=3D=3D'date'"&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;dtml-tree sort=3D"date"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a=20
href=3D"&amp;dtml-absolute_url;" target=3D"previewPanel"&gt;&lt;dtml-var =

title&gt;&lt;/a&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/dtml-tree&gt;<BR><FONT =
face=3DArial=20
size=3D2>&nbsp; &lt;/dtml-if&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>Does somebody knows how to render this variable?<BR><BR>Thanks in=20
advanced,</DIV>
<DIV>Josef.</DIV></FONT></DIV></BODY></HTML>

------=_NextPart_000_0009_01C17B73.A08F5CD0--