Forum OpenACS Q&A: Templating static content

Collapse
Posted by Ola Hansson on
In my struggle to put together a personal site with OpenACS 4 a few
questions arose regarding the templating of static pages (or, rather,
the lack thereof). In this case the content will mostly consist of
DocBook-created html documents.

Html pages don't get templated, even though they are registered with
the static-pages module. I think it would be desirable if html pages
could be templated too.

One workaround seemed to be to create .adp files instead of .html
files (which DocBook can do for you) and then add <master> tags
at the top of each document (which DocBook cannot do for you).
Unfortunately this doesn't help me because the internal crosslinks
within the documents created by DocBook have non-abstract references
(i.e. "filename.adp" as opposed to "filename"). The request processor
won't serve the templated version of the page if the extension is
included (doh!).

Anyway, to demand of every DocBook author using OpenACS 4 to undertake
substantial hacking of the DSSSL or XSLT stylesheets seems awkward,
not to mention the hacking of all the legacy html docs out there...

Would it be possible to hack the RP (or whatever) so that it can
deliver good ol' HTML pages wrapped in templates?

Collapse
Posted by Steve Woodcock on
You sure can. We modified sp_serve_html_page in static-pages to pull out the body of the html page and parse it into a normal .adp (which includes a <master> tag). I can't generate a diff against CVS easily, but I'll mail you the whole proc if you like.
Collapse
Posted by Ola Hansson on
That's great to hear, Steve! By all means, please send me a copy.

Thanks a lot,

Collapse
Posted by Don Baccus on
This sounds like an excellent candidate to be added to static pages with parameterization, don't you think?  Turn it off for faster performance if you don't want templating, turn it on if you do ...