[Zope] Using Links within Zope

Ben Glazer glazer@scicomp.com
Wed, 9 Feb 2000 16:56:55 -0600


On Feb 08 2000 at 10:08 PM, Eron Lloyd wrote:
> Thanks for the help with images. I've just completed a 6 pg. how-to on
> it, which will be up for public consumption as soon as I get approval
> from ZDP.
...
> Ideas? Pour 'em out, I'm willing to write as much as I learn.

The Zope community could use more people like you!  Thanks very much for
your willingness to translate answers to your questions into
publicly-availible documentation!  (On that note, I'm looking forward to
reading your Images How-To.)


> My next question is: Linking in Zope - is there anything special (yet
> basic enough) that can be done besides a "<a href="some.object">click
> here</a>" type of link? Any DTML-special stuff? Especially useful would
> be implementing a navigation bar that trails behind each level deep into
> the heirarchy you go. How to generate the links, etc. and what DTML
> would need to be used.

Constructing links with something like

	<a href="some.object">

won't work, unless "some.object" is actually the name of a file in the
current folder you want to access.  Instead, you'll need to do something
like

	<a href="relative/path/to/some/object.html">
or
	<a href="<dtml-var "fully.qualified.object.absolute_url()">">

As I understand it, the following should work according to the
documentation, but as noted on the list yesterday by Jarkko Kniivila
(http://www.egroups.com/group/zope/22592.html), it doesn't seem to be
functional in Zope 2.1.3:

	<a href="&dtml-url.object;">

Please note that all of these examples are completely untested, and may
therefore be completely incorrect.

Also, filenames that have dashes or dots in them can really complicate
things, since Python interprets these symbols as operators as opposed to
part of the object's name.  Someone who knows a bit more than I do about
these pitfalls might be willing to elucidate.


On a related topic, it might also be interesting to find out more about how
to create navigation bars (top and side), though that could probably amount
to a separate How-To altogether.  I know Jonas has written a ZNavigator
product (http://www.zope.org/Members/jonas/ZNavigator), but I haven't
personally played around with it yet.  Maybe it's sufficiently full-featured
that no other navbar generation methods are ever necessary.


Regards,
Ben