[Helma-user] Displaying a page trail
Chris Zumbrunn
chris at zumbrunn.com
Tue Mar 25 00:27:43 CET 2008
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
More information about the Helma-user
mailing list