[ZCM] [ZC] 1252/ 7 Comment "VIRTUAL_URL"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Aug 2 13:13:56 EDT 2004


Issue #1252 Update (Comment) "VIRTUAL_URL"
 Status Resolved, Zope/bug medium
To followup, visit:
  http://zope.org/Collectors/Zope/1252

==============================================================
= Comment - Entry #7 by yuppie on Aug 2, 2004 1:13 pm

This is *not* resolved. In Zope 2.7 VIRTUAL_URL was added, but it is only available if a VHM exists. This makes it hard to write code that works with and without a VHM.
________________________________________
= Resolve - Entry #6 by chrisw on Jul 30, 2004 7:50 am

 Status: Pending => Resolved

It would appear Evan added this functionality in Zope 2.7, so this is resolved.
________________________________________
= Comment - Entry #5 by ajung on May 14, 2004 1:10 am

Similiar issue: #1308
________________________________________
= Comment - Entry #4 by chrisw on Mar 8, 2004 8:30 am

Why on earth did it end up being called VIRTUAL_URL?

I still don't really see the usecase for this, but the functionality is there, so I'll just keep quiet...
________________________________________
= Comment - Entry #3 by yuppie on Mar 8, 2004 8:22 am

@ chrisw:

See my request
<http://mail.zope.org/pipermail/zope-dev/2003-December/021100.html>
and Casey's reply
<http://mail.zope.org/pipermail/zope-dev/2003-December/021101.html>
for reasons why Evan added VIRTUAL_URL in Zope 2.7.

absolute_url() does not return the same URL. VIRTUAL_URL works fine if you have a VHM.

________________________________________
= Comment - Entry #2 by chrisw on Mar 8, 2004 6:18 am

While I'm tempted just to out-and-out reject this, my name isn't Andreas ;-)

Why not just use here/absolute_url or container/absolute_url, depending on what it is you actually want to do?

Any code that uses a fixed string URL like SERVER_URL or VIRTUAL_URL is gonna be pretty fragile...
________________________________________
= Request - Entry #1 by yuppie on Mar 8, 2004 5:49 am

On Zope-CMF Alexander Limi wrote:
[...]
> I investigate the options i have, noting that no variable seems to keep  
> the actual URL that is *inside the fecking URL bar* in my browser.
> 
> I turn to Simon Eisenmann for help, he comes up with an idea of using a  
> combination of SERVER_URL and PATH_TRANSLATED to construct the actual 
> URL  we're at.
> 
> But guess what? This doesn't work in Virtual Hosting scenarioes. So we  
> have to create an additional rule that gets rendered if you have a 
> Virtual  Hosted system.
> 
> The rule ends up looking like this:
> 
> <a
>  tal:define="url  
> request/VIRTUAL_URL|string:${request/SERVER_URL}${request/PATH_TRANSLATED}"
>  tal:attributes="href string:${url}#someContent"
> 
>> Skip to content</a>
> 
> 
> Easy, right?
[...]

I think this is a bug. VIRTUAL_URL should always be available. This would make it much easier to use:

  <a tal:attributes="href string:${request/VIRTUAL_URL}#someContent"
  > Skip to content</a>

==============================================================



More information about the Zope-Collector-Monitor mailing list