In order to provide different "views" of the same document (for instance with different languages, as described in
TWikiPluginAPI, I think that one could customize the choice of the template too, using a
%TEMPLATE% variable. This would superseed the choice of templates using directories, as happens now in the
templates directory.
Moreover, the template could be sent in the url, too. This would allow for instance the coexistence of frame and frameless (as it is now) views of the same document. The framed view could be organized
in three panels, one (at the top) with the buttons, one with the text and a side une with the index of topics in the web, and the indices of the webs (a classic "file navigator", see
IndexWhenEditing). The choice of the templates
(which are different from the usual one) is done using a
/twiki/bin/view/Main/SomeTopic?template=view.tmpl syntax, so that the template for the frame itself can build the different views.
Ok, I'll experiment a bit with it.
--
FrancoBagnoli - 01 Oct 2000
When implementing a multi-language system, I found myself copying and editing templates just to translate the english words. This cause a lot of troubles for maintenace, which is made worse if I have small modifications in different webs (I partially solved it using symbolic links).
I was thinking to implementing an IF clause in templates, then I realized that I was rewriting
HTML::Template, so I wonder if we could switch to this package. It would offer IF-THEN-ELSE contruct and also a robust LOOP, which would avoid the splitting of templates
(as is done in wikisearch, for instance). One could retain compatibility by using a different name for the new templates, and adding a piece of code in readTemplate.
--
FrancoBagnoli - 09 Oct 2000
I've thought about using something like
HTML::Template or Template::Toolkit. The best method would be to have the edit/preview/save path generate and store Temaplate tags. This depends on things like how a plugable render unit might work, and the store mechanism.
Implementing IF-THEN-ELSE template switchs for internationisation seems a bit murky. Confusing the render path/interface with the content requirements.
I think something more like particular TAGs for button labels, menu options, etc. Then have a pre render phase convert that into multi-language templates.
--
NicholasLee - 10 Oct 2000