[Zope] Generating links from a list

Nikko Wolf nikko-wolf at earthlink.net
Mon Jun 27 12:03:08 EDT 2005


John Poltorak wrote:

> My links list consists of simple lines such as
> 
> org-1,First link
> org-2,Second Link
> org-x,Another Link
> 
> How do I prepend a hardcoded path to org-1 instead of what is getting 
> generated?

> I would like to see the link for org-1 being generated as
> 
> http://www.mysite.org/links/org-1

Check the "HREF" attribute of the links in the generated HTML, and see 
what you are getting there; unrooted paths are appended (by the browser, 
not Zope) to the directory component of the source URL.

For example:       <A HREF="org-2">Second Link</A>
in a page at:      http://mysite.org/links/org-1
should equate to:  http://mysite.org/links/org-2

[If you're still having problems, be explicit on the HREF and the URL 
you are seeing.]



And have you tried simply replacing "org-1" in the File with 
"http://www.mysite.org/links/org-1" ?



Finally -- from the ZPT snippet, it looks like "links" is a File object, 
yet you put it in the URL that you say you wish.  It's *sometimes* not a 
problem given Zope's sibling-acquisition when parsing paths, but could be.


G'Luck
Nikko



More information about the Zope mailing list