[Zope3-dev] Relative links

Chris Withers chrisw@nipltd.com
Fri, 29 Mar 2002 16:48:18 +0000


Guido van Rossum wrote:
> 
> > Chris McDonough wrote:
> > >
> > > http://lists.zope.org/pipermail/zope-coders/2001-November/000460.html . I
> > > believe the only other option with the current state of affairs is
> > > redirection to "container/" when you visit a containerish object.
> >
> > I've always seen that as a much nicer and more 'correct' approach.
> 
> -1.

Are you sure you mean -1 there? The rest of you mail suggest you prefer the
redirect over the BASE tag. The redirect is what I was suggesting ;-)

> My objection to <base> is not to the fact that it is inserted using an
> ugly hack (which it is -- occasionally it doesn't get inserted, when
> your template is missing a </head>).

...yum yum ;-)

> My beef is that for sites (or sections of sites) that to the user
> resemble a collection of static HTML, sucking down a copy for a mirror
> (possibly for private use only) becomes much harder.  This is because
> the <base> elements remain in the mirrored pages, so the mirrored
> links point back to the original site rather than to the mirror.

...yet another reason why BASE tags suck.

> I still think that the best solution is what Apache does for
> directories (redirect to the directory with a / appended).  I do see
> that for some sites this might be too expensive, so it should be a
> site (or subtree) configuration parameter.

Yup, this is prettymuch what I was suggesting. And, to be honest, I don't see it
as essential that it's configurable. Once you've educated users and things like
absolute_url (or its Zope 3 equivalent) to generate URLs ending in / for
containerish objects, then the redirect won't ever be called and so the BASE tag
doesn't even need to be supplied as an option...

> I think the default should be the redirect (thus giving all of you the
> ability to earn some consilting dollars for performance tuning sites
> :-).

:-)

> I keep harping on this issue because the python.org site is carefully
> constructed using relative URLs only to allow easy mirroring, and
> there are dozens of mirrors; I couldn't consider migrating python.org
> to Zope without a decent approach to relative URLs.

...wow, I'm in agreement with a BDFL or Pope for the first time in a long time
;-)

> This issue is also one of the last issues that bug me in the jobboard
> example; when I point my browser to http://localhost:8080/jobboard/ I
> get a <base> tag with an href attribute pointing to
> http://localhost:8080/jobboard/summary/index.html.  I really wish the
> "summary/" part was unnecessary (the "index.html" part is already
> unnecessary).  But I can't figure out how to do this.

...yuk! Surely things shouldn't be starting to feel hackish this early in Zope 3
development?!

cheers,

Chris