[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 I can 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> </DIV>
<DIV><FONT face=3DArial size=3D2> <dtml-unless =
treeOrder></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
<dtml-call=20
"REQUEST.set('treeOrder','title')"><BR></FONT><FONT face=3DArial =
size=3D2> =20
</dtml-unless></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <dtml-tree=20
sort=3DtreeOrder><BR> <a =
href=3D"&dtml-absolute_url;"=20
target=3D"previewPanel"><dtml-var title></a><BR> =20
</dtml-tree></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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> &nbs=
p; =20
Error Type:=20
AttributeError<BR> &=
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" </FONT></FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>sort=3D&dtml-treeOrder; </FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>sort=3D"&dtml-treeOrder;"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Currently I am using this =
solution, which=20
works, but it isn't clean:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2> <dtml-unless=20
treeOrder><BR> <dtml-call=20
"REQUEST.set('treeOrder','title')"><BR> =
</dtml-unless><BR> =20
<dtml-if expr=3D"treeOrder=3D=3D'title'"><BR> =
<dtml-tree=20
sort=3D"title"><BR> <a=20
href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a><BR> </dtml-tree><BR> =20
<dtml-elif expr=3D"treeOrder=3D=3D'id'"><BR> =
<dtml-tree=20
sort=3D"id"><BR> <a=20
href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a><BR> =
</dtml-tree></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <dtml-elif=20
expr=3D"treeOrder=3D=3D'user'"><BR> <dtml-tree=20
sort=3D"user"><BR> <a=20
href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a><BR> =
</dtml-tree></FONT></DIV>
<DIV> <dtml-elif =
expr=3D"treeOrder=3D=3D'date'"><BR> =20
<dtml-tree sort=3D"date"><BR> <a=20
href=3D"&dtml-absolute_url;" target=3D"previewPanel"><dtml-var =
title></a><BR> </dtml-tree><BR><FONT =
face=3DArial=20
size=3D2> </dtml-if></FONT></DIV>
<DIV> </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--