[Zope] URL and #tree trouble...

Martijn Pieters mj@antraciet.nl
Fri, 26 Mar 1999 09:38:11 +0100


At 08:16 26/03/99 , Raver wrote:
>Q1
>
[SNIP]...
>
>index_html (Top) has <A HREF="F2">F2</A>
>index_html (F2) has <A HREF="F2-folder1">F21</A> and <A HREF="Top">Top</A>
>
>Starting at URL: localhost/Top is fine and following links to F2 and from 
>there on to F2-folder is correct (URL beeing localhost/Tope/F2/F2-folder1), 
>but if I, when in F2, press the link to 'Top' something strange? happens: I 
>get to Top all rigth, but the URL is now localhost/Top/F2/Top (Top beeing 
>appended to the URL)
>
>What am I dooing wrong?
>

You're URL is a relative one. The browser sees 'Top', and requests the
object Top with the current Base URL, which is localhost/Top/F2/. And
because of Aquisition, Top.F2.Top exists.... And so will
Top.F2.Top.F2.Top.F2.... which can get you into a nice caching problem.


>Q2
>
>Recently I got help on using the #tree tag, and apparantly everything worked 
>all rigth, but ...
>
>I get the tree-view, can expand the tree pressing either foldernames or the 
>'+' button - fine. But If I press the '+' button I'm not able top directly 
>access the files appearing (404 error, file not found), I have to enter the 
>folder first before I can get the file. This seems strange and I want to 
>know if theres a solution to this.
>
>Heres my #tree href part:
>
><A HREF="<!--#var URL1-->/<!--#var id-->"><!--#var id--></A>
>
>Help is much appreciated

Your URL should include the realitve path to the subfolder. the var
tree-item-url gives you the URL to the current object, relative to the base
object.

Your code should read (untested):
<A HREF="<!--#var URL1-->/<!--#var tree-item-url-->"><!--#var id--></A>

Or words to that effect..


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