[Zope3-dev] Re: Apache rewrite rules and URLs: an experiment

Jim Fulton jim at zope.com
Tue Nov 2 09:06:32 EST 2004


Peter Mayne wrote:
> Jim Fulton wrote:
> 
>> You want:
>>
>>    <a tal:attributes="href context/++resource++z3logo.gif">
>>
>> ++resource++name gets a resource *object*.  When it is converted to
>> a string by tal:attributes, an absolute URL is computed based on
>> the location of the enclosing site.
> 
> 
> Nice.
> 
> What if the path doesn't involve a resource, such as a link to the home 
> page or a site map page?

If you always want to link to a page of the site, then get the current site
and construct a url relative to the site's url. Perhaps we'll want
apis to make this easier. <shrug/>  For now, on the trunk, you can
use zope.app.zapi.getSite() to get the site. (On the branch, you hace
to use zope.app.component.hooks.getSite().)

Jim


-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list