Forum OpenACS Development: Re: Xowiki/Templating best practice

Posted by Gustaf Neumann on
The theme packages OpenACS we have now are mostly for site-specific theming (colors, logos, css, js) but these are not sufficient for programmatic modifications introduced by different JS toolkits. E.g. some tree renders are purely JavaScript-based, others are based on e.g. div or list structures.

Therefore, xowiki has a site-wide parameter "PreferredCSSToolkit", which can be used to switch in essence between the old YUI style to the newer boostrap3 style of rendering. There are certainly for newer bootstrap versions (4 and 5) some differences, such as different button classes, or differences in the icon management (e.g. dropped glyphicon library in bootstrap4(, grid changes, etc... but many things work as before.

To address this, the change [1] was introduced shortly before the release of OpenACS 5.10.0 to provide a basis for a common bootstrap version, supporting as well newer versions. Our take was to skip Bootstrap4 and to go for Bootstrap5 which offers more options for the icon library. One challenge is to provide an easy setup optionally using the CDN like what we have for Bootstrap3. But for now, it is not clear, how much resources we can invest here in the short-range.

The way to go is to extend the "PreferredCSSToolkit" with newer bootstrap versions and to use the abstractions provided by [1]. The provided dict has to be extended, but when this is done, the goal is to switch between these major bootstrap revisions without code changes.


Posted by Paul Babin on
As always, thank you greatly for this insight into the development process. This helps me greatly in developing on our end without hacking "core" files. I believe this will be sufficient for us to modify what we need on our end
Posted by Gustaf Neumann on
Dear Paul,

you might have noticed the new bootstrap5 theme in the oacs-5-10 branch. The support (including theme switching for programmatically generated HTML) is growing and should be part of OpenACS 5.10.1

all the best