[Zope-CMF] Need for portal_url tool?

Chris Withers chrisw@nipltd.com
Sat, 2 Jun 2001 17:26:47 +0100


> > > Surely all portal content will have an absolute_url method which takes
> > > virtual hosting into account and will probably be more reliable?
>
> The provides for getting a relative url for an object relative to another,
> and i think other things.  It's more than just absolute URL.  Further, it
> reduces clutter in the interface to a content object - when we want to add
> more url-related functionality, we put it in the tool, and people know to
> look there for that functionality.
>
> (There's valid reasons on both sides of the argument about where to put
> the functionality, but the CMF stresses lightweight content objects, and
> the model seems to be going well - tool proliferation notwithstanding...)

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...

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>

cheers,

Chris