[ZCM] [ZC] 1252/ 2 Comment "VIRTUAL_URL"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Mon Mar 8 06:18:08 EST 2004
Issue #1252 Update (Comment) "VIRTUAL_URL"
Status Pending, Zope/bug medium
To followup, visit:
http://collector.zope.org/Zope/1252
==============================================================
= 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