Forum OpenACS Development: Response to Breadcrumb trail service?

Collapse
Posted by Ed Avis on
Replying to Michael Feldstein's reply to my reply...

ad_context_bar doesn't need any special setting up.  Just try calling it in a Tcl page and including the output (not quoted) in the corresponding ADP.  The _best_ way to do it is to have the context bar in the site master template, so it appears in a consistent place everywhere, but that's not necessary (and not usually done at present).

About a database hit for each context bar: well I'm pretty sure that ad_context_bar will look at the database already to find out the site layout (unless it does something interesting like asking the request dispatcher (or whatever it's called)).  So another hit for configuration would not be such a big deal.  I don't think caching is necessarily a good idea; one of the principles of ACS design is not trying to outsmart the DBMS.

Adding context bars to 'static pages' is an instance of the general problem of having a static page with some small amount of dynamic stuff.  I still think that the best answer is to have a trivial Tcl file for each page and maintain the static page as ADP (which can be pretty much a plain HTML document).  If you wanted a site-wide master template for your static pages, or any other fancy effect, you'd need to use ADPs _anyway_.  They are designed to be editable with ordinary HTML tools - the only difference is <master> at the top instead of <html> etc, and one extra line @context_bar;noquote@ (or whatever it is in OpenACS).

If you wanted anything even less technical and even more friendly then you'd probably dispense with editing files altogether and go for some kind of CMS.  Of course there it is easy to make the CMS package add a context bar to each page.