Forum OpenACS Q&A: Making the Package instance aware of templates

While I was doing some stuff on news module on OpenACS 4.x. I had an idea. I think we should make a template parameter for all userland packages.

Each template has www/master.adp or some sort of form. What if I wanted news module mounted on /news and /intranet/news and they both looked differently? Now I have to modify news to detect which template to server. I think we should make each userland packages accept a master template parameter. So each instance can use a different template.

The template will now be used on master.adp's master src="[master_template_parameter]"

Another semi-related question. Is there a way for me to get the template <slave> content. Instead of dishing it out to the browser I want process / massage it a bit.

A useful stuff is say instead of bboard will dish out HTML I make it dish out XML. This way I can use bboard on different parts of site. Each bboard instance can RADICALLY look different. It is possible for the current OpenACS 4 if:

  • each package can have a master template value.
  • slave content can be put into a string. I mean i can use master src="/templates/cool". And there will be cool.tcl and cool.adp. cool.tcl will do XSLT or just plain regsub stuff then merge it to cool.adp.

The great advantage of this is that it paves the way to reuse and reuse different modules that really look different from one part of you site to another.

Jun