[Zope] URL0 returns index_html not index.html

John Eikenberry jae-zope at kavi.com
Thu Aug 18 14:42:42 EDT 2005


Mark Barratt wrote:

> Zope 2.7.4 on Debian
> 
> DTML method index_html in the root says <dtml-var "_['index.html']">
> 
> A link in a page template to
> 
> tal:attributes="href string:${context/REQUEST/URL0}/source.html

URL0 always(?) includes the ending published object (eg. index_html).
Normally if you don't want this you just use URL1.

> where the page is addressed by [path]/ and is actually at [path]/index.html
> 
> returns [path]/index_html/source.html

Using URL1 you should get [path]/source.html which would seem to me to be
what you want.
 
> I can vaguely see why this is happening. My question: is there a 
> straightforward way of making the links (and error reports) return the 
> actual page address?

By actual page address you want the URL with index.html instead of
index_html? Given your current setup as described, redirecting would work.

<dtml-call "RESPONSE.redirect(URL1+'/index.html')>

Though this would cause every hit on a page's index to tranverse twice. If
the site isn't super high traffic it wouldn't be noticable.

If you were working with zope projects there are other tricks you could
pull, but it doesn't sound like you are doing this.

> (I think I understand that 'actual' 'page' and 'address' are all 
> metaphors which may be leading me into error... )

In zope there is the URL which represents the object traversal and there is
the returned content (html, images, etc). The returned content (maybe what
you mean by actual page) can feasibly come from some other part of the
site, a database, or just about anything else. The URL or address is just
what method/object gets run to get said content.

> Thanks for any help/enlightenment.
 
Not sure if I'm making this much clearer. But there it is anyways.
 

-- 

John Eikenberry [jae at kavi.com]
______________________________________________________________
"A society that will trade a little liberty for a little order
 will deserve neither and lose both."
                                          --B. Franklin


More information about the Zope mailing list