Forum OpenACS Development: Response to Breadcrumb trail service?

Collapse
Posted by Ed Avis on
(Disclaimer: this answer is based on ACS Tcl 4.2 - but surely the ad_context_bar proc I refer to is included in OpenACS as well?)

Application packages already do create breadcrumb trails using the site map.  It's called ad_context_bar.  The best thing is to set a variable called context_bar and include it in the master ADP template so the context bar appears in the same place on each page.  Just calling ad_context_bar with one argument (the page's title) will usually do something reasonable; alternatively you can customize things a bit further by giving multiple arguments or just write the context bar by hand.

Adding a context bar to static pages - well just rename .html to .adp, make sure <master> is in there, and make a .tcl file which does nothing but set the context_bar variable.

Changing the root of the context bar: I suppose that ad_context_bar could be extended to have some configurability.  I'd be wary of doing a database hit to get the configuration data though, because it happens on every single page.

Utility to view the site map: there are probably some utility procs to do some of this already.