[Zope] Solved: How to get the url without the domain...

Ausum Ausum" <webmaster@enjoyperu.com
Tue, 6 Mar 2001 21:25:37 -0500


I've just found a workaround based on a previous message by T.J. Mannos:

<dtml-in "folder.objectItems()">
  <dtml-let transitional_variable=absolute_url>
      <dtml-var "_.string.split(_.str(transitional_variable), ':8080')[1]" ><br>
  </dtml-let>
</dtml-in>

Given the fact that the port number is always present in the absolute_url
variable (in Zope), it's convenient to use it as a string to delimit the needed
part of the url.  If this were not the case, I guess it's possible to use any
part of the domain name close to the first slash after it.


Ausum



----- Mensaje original -----
De: "Ausum" <augusto@artlover.com>
Para: <zope@zope.org>
Enviado: Martes, 06 de Marzo de 2001 08:12 p.m.
Asunto: [Zope] How to get the url without the domain part, using <dtml-in>?


> Is it possible to return the absolute url without the domain/IP part, while in
> an iteration? With absolute_url   I get this:
>
> http://100.0.0.1/folder0/folder1/folder2/current_object ,
>
> and instead I'd like to have this:
>
> /folder0/folder1/folder2/current_object
>
> I tried the BASEPATH special variable, but it seems that it doesn't work
within
> <dtml-in>. The other downside is that it needs an argument to get to know the
> nesting level of the object.
>
> Has anyone found a workaround?
>
>
> Thanks in advance,
>
>
> Ausum
>