[Zope] dtml-tree: Folder listing from different area(s)
sbabu@tnc.org
sbabu@tnc.org
Sat, 10 Mar 2001 18:21:15 EST
Hi,
I've a requirement where my application needs to
just browse the folder listing using collapsible/expandable
trees. dtml-tree is just perfect for this.
My application has a DTML document called
/myapplication/browse_files.htm
I pass a variable to this called BASEURL and that
is the root URL from where I want the hierarchy
to be displayed.
Code is like this: Assume BASEURL has a value
http://localhost:8080/mysite1/subsite2/
<dtml-try>
<dtml-with "REQUEST.resolve_url(BASEURL)">
<dtml-call "REQUEST.set('currFolderId',id)">
<dtml-tree currFolderId branches_expr="objectValues(['Folder', 'DTML Document','Image','File'])" nowrap=1 sort=id>
<IMG SRC="<dtml-var SCRIPT_NAME>/<dtml-var icon>">
<A HREF="<dtml-var absolute_url>"><dtml-var title_or_id></a>
</dtml-tree>
</dtml-with>
<dtml-except>
Error here
</dtml-try>
Now it all works fine initially. When the + sign
is clicked to expand a folder, the BASEURL is
not passed forward to the resulting display. That
causes an error. I'm now passing BASEURL as a session
variable, which I think is an ugly solution.
My question is:
1. Is there any way I can pass BASEURL to the URLs
generated when tree is browsed?
2. Or is there anyway this BASEURL thing can be
avoided in the drill-down pages?
If it helps, my application is something which will
allow users to browse the folder structure and choose
a document to make a hyper link from their document.
Any pointers, solutions etc will be greatly appreciated.
TIA
http://vsbabu.csoft.net
"The man who smiles when things go wrong has thought of someone to blame it on." --- Jone's Law