Re: Displaying a page trail
Chris Zumbrunn <[email protected]> Tue, 25 Mar 2008 00:27:43 +0100
| Newsgroups | gmane.comp.java.helma.general |
|---|---|
| Message-ID | <1941741.367481206400846311.JavaMail.root@engine234.deployzone.net> |
On Mar 24, 2008, at 21:17 , Dan Stanger wrote:
> Hello All,
> Many of the helma pages have a page trail for example:
> helma.org > Home > docs > tools
>
> Is there an example of how to create this in helma?
In addition to what Joshua said, the objects in the URI request path
are accessible as array members of the global path object:
http://helma.zumbrunn.com/reference/global.html#path
Also, you should be able to access the immediate parent of a hopobject
using its _parent property, like I'm doing here:
/**
* Provides an array of the path breadcrumbs from
* the this Mocha object up to the root object.
*/
Mocha.prototype.__defineGetter__('path',function() {
var breadcrumbs = [];
var obj = this;
do {
breadcrumbs.push(obj);
}
while (obj = obj._parent);
return breadcrumbs;
});
http://code.google.com/p/e4xd/source/browse/trunk/objectengine/Mocha/lib.js
Cheers,
Chris