[Zope-CMF] Need for portal_url tool?

Tres Seaver tseaver@palladion.com
Sat, 02 Jun 2001 14:08:15 -0400


Chris Withers wrote:


> 
> Yeah, I'm starting to see that :-) However, surely every object playing in
> the CMF world does (or should...) have an absolute URL method?
> 
> I've seen this sort of things a few places in skins:
> <img src="&dtml-portal_url;&dtml-getIcon;">
> 
> ...where I'd much prefer to just see:
> <img src="&dtml.url-icon;">
> ...or something similar...


Consider that, for caching purposes, you *really* want all the icons to
have a single, fixed URL;  making the URL relative to the content object
would mean that the icon almost never got cached.


> 
> Better still would be to make images such as icons a bit smarter so that
> they can render their own image tag correctly, then we could have:
> 
> <dtml-var icon missing>
> 
> ...rather than:
> 
> <dtml-if icon>
> <img src="&dtml-portal_url;&dtml-getIcon;" border=0 alt="&dtml-Type;">
> </dtml-if>


Live with it a while longer;  having an easy way to mention the
*site* URL is a blessing (and the tool can do other tricks, like computing
a physical path relative to the CMFSite).

The tool won't go away, so feel free to tilt at windmills if you like. :)

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org