Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

how get a relative root from

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


yourpadre at gmail

Aug 20, 2009, 3:31 PM

Post #1 of 3 (1426 views)
Permalink
how get a relative root from

Hi list

how can do a script what return the relative parent from it self?

I use virtual_hosting and because a configuration I need access to my site
like http://mysite or http://192.168.1.1/mysite.
The problem is I have a _menu_ with absolute path, working fine using
http://mysite but not the other way


My actual menu is like this:
<ul id="nav">
<li>
<a href="/finanza/proyecto/">Proyecto</a>
<ul class="menu">
<li><a href="/finanza/proyecto/alta">Alta</a></li>
<li><a href="/finanza/proyecto/busqueda">Busqueda</a></li>
</ul>
</li>
</ul>

and need when is loaded from http://192.168.1.1/mysite
<ul id="nav">
<li>
<a href="/mysite/finanza/proyecto/">Proyecto</a>
<ul class="menu">
<li><a href="/mysite/finanza/proyecto/alta">Alta</a></li>
<li><a href="/mysite/finanza/proyecto/busqueda">Busqueda</a></li>
</ul>
</li>
</ul>

can someone say me how do it? thanks
--
________________________________________
Lo bueno de vivir un dia mas
es saber que nos queda un dia menos de vida


robert at redcor

Aug 20, 2009, 10:03 PM

Post #2 of 3 (1260 views)
Permalink
Re: how get a relative root from [In reply to]

if you look in the request, there is
PATH_INFO
from which you can deduct the path you are using.

robert
Miguel Beltran R. schrieb:
> Hi list
>
> how can do a script what return the relative parent from it self?
>
> I use virtual_hosting and because a configuration I need access to my
> site like http://mysite or http://192.168.1.1/mysite.
> The problem is I have a _menu_ with absolute path, working fine using
> http://mysite but not the other way
>
>
> My actual menu is like this:
> <ul id="nav">
> <li>
> <a href="/finanza/proyecto/">Proyecto</a>
> <ul class="menu">
> <li><a href="/finanza/proyecto/alta">Alta</a></li>
> <li><a href="/finanza/proyecto/busqueda">Busqueda</a></li>
> </ul>
> </li>
> </ul>
>
> and need when is loaded from http://192.168.1.1/mysite
> <ul id="nav">
> <li>
> <a href="/mysite/finanza/proyecto/">Proyecto</a>
> <ul class="menu">
> <li><a href="/mysite/finanza/proyecto/alta">Alta</a></li>
> <li><a href="/mysite/finanza/proyecto/busqueda">Busqueda</a></li>
> </ul>
> </li>
> </ul>
>
> can someone say me how do it? thanks
> --
> ________________________________________
> Lo bueno de vivir un dia mas
> es saber que nos queda un dia menos de vida
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Zope maillist - Zope [at] zope
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )

_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


yourpadre at gmail

Aug 25, 2009, 8:29 AM

Post #3 of 3 (1245 views)
Permalink
Re: how get a relative root from [In reply to]

I resolve using this script

[getmyroot_py]
request = container.REQUEST
if request.has_key("VirtualRootPhysicalPath"):
s=""
else:
s=request.BASE2
return s



[menu]
<dtml-let myroot="getmyroot_py">
<ul id="nav">
<li>
<a href="&dtml-myroot;/finanza/proyecto/">Proyecto</a>
<ul class="menu">
<li><a href="&dtml-myroot;/finanza/proyecto/alta">Alta</a></li>
<li><a
href="&dtml-myroot;/finanza/proyecto/busqueda">Busqueda</a></li>
</ul>
</li>
</ul>
</dtml-let>

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.