Splitting presentation and content in Oops Templates
I just came across some discussion about splitting TWiki up to allow
TWikiML to be used to generate non-HTML views of content. However, all of the error-message code in TWiki uses sets of 'Oops' templates to define both the message and the format of said message. I was wondering if it would be logical to split off a
TWikiML error-message definition that's not
HTML-specific and have the templates use that somehow. This might also help with
L10N of errors if we could set it up so that translating those
WikiML documents would translate the entire error message. A
WikiML page would be a lot easier to work with than a cryptic (and skin-specific) oops template.
It could even be set up so that these 'base' messages are stored in TWiki topics, say in the
TWiki web.
NamedIncludeSections could be used to split out the content bits currently defined via %TMPL:DEF%'s.
--
WalterMundt - 09 Feb 2004
I agree - such messages should certainly be stored in topics.
--
MartinCleaver - 10 Feb 2004
Agreed. In most cases, each oops message could be reduced to a one liner, represented as a table row or a bullet with some separator. Example for
oopsattachnotopic.tmpl:
| ID |
Type |
Heading |
Message |
Action |
| oopsattachnotopic |
Attention |
Topic %TOPIC% does not exist |
You cannot attach a file to a non-existing topic. Please create the topic first before you attach files to it. |
View %SEP% Edit %SEP% Cancel |
(Preventing the escaping of variabes needs to be figured out)
This is a dense format, easy to localize. The disadvantage of this compact format is that you can only use a limited set of the
TWikiML.
This could be easily maintained and localized. The oops mechanism could search the ID first in the templates, then in a site-wide oops message topic. The search could be extended for Plugins, e.g. search Plugin topics for oops messages.
--
PeterThoeny - 10 Feb 2004