Forum OpenACS Q&A: Response to Different look of every instance of given package

Hi Marcel,

Currently out of the box 4.5 does not yet support this. But in the future it may. I have given my idea to DonB about this. Maybe you would like to implement or help out in the idea.

Here is the snip that I gave Don.


In OACS we can surely implement something that will transform html package output into different looks at different instances. Here it goes:

/packages/bboard/www/master.adp will contain something like this.

<master>
<table class=datarows>
        <tr>
        <th>message title</th>
        <th>author</th>
        </tr>
        <mutiple> (damn forgot the syntax... you know what I mean)
                :       
        </multiple>
</table>

Notice that its still html nothing fancy but no formatting stuff.

Subsite template or your idea of each folder can be set a template. Will look at ad_paramter Transform type. This can be: tcl proc, XSLT, CSS.

- tcl proc is like "new_page [transform_page slave_content]" where transform_page is a bunch of regexp, if then etc. What ever the programmer wants to do with the thrown content of the package "slave_content" to be come his "new_page".

- XSLT... err buzzword and standards compliant to do this stuff. Should be slower than regexps.

- CSS... does nothing same as now, but the problem is we don't have a standard markup languange. So we can't apply CSS to all packages.

What we need to do is:

1. Use XHTML on all pages. We don't really need to impose all but we must start. Since CSS method is already here. We just agree what CSS classes and markup we need. We just use plain XHTML so the option of just using CSS will not require anyback end processing.

2. Make a standard on the new markup like: Table that is a row data

<table class=datarows>
<tr>
        <th>row header</th>
</tr>
<tr>
        <td>data</td>
</tr>
</table>

Form to input data

<form class=dataentry>
        <table>
                <tr>
                        <td class=label>Name</td>
                        <td class=datainput><input type=text></td>
                </tr>
        </table>
</form>

3. modify acs-template a bit. Not too sure but this is where you can tell me (DonB) if there is a lot of stuff to do or not.

This way we can have simple developers with html still continue on with html but in a standard way. And we have the power of transforming content like CCM's bebop. But unlike bebop we can offer 3 types of transformation XSLT, tcl code (regexp, concat, etc.) and still fall back to good old html. No processing required just CSS. Bebop only supports XSLT.


The above idea is just preliminary. There are still things that needs to be worked out. But on the high level this should do what you want.