The current
TWikiTemplates are used for two purposes: For page layout (script templates, i.e.
view.tmpl) and for content (new topics, i.e.
notext.tmpl).
We should seperate that, e.g. take the content files out of the templates directory and place them into a TWiki web. Advantage: You can edit them like any regular topic. Template files in question:
| Current: |
New: |
What it is: |
notext.tmpl |
NewTopicViewTemplate |
Default text shown when you view a non existing topic. |
notwiki.tmpl |
NewTopicNonWikiTemplate |
Default text shown when you view a non existing topic that has a non WikiName. |
notedited.tmpl |
NewTopicEditTemplate |
Default text shown when you edit a non existing topic. |
Question is how to handle different webs. There is a default template directory but there is no default web. Well, actually there
is a default "Main" web as defined by
$mainWebname. We could define a new
$defaulyWebname for that.
The reason I would like to see this change is flexibility in creating new topics:
- Create several "new topic templates" and let the user select the one he/she wants.
- Have a form where you can enter a topic name to create. Pressing [Create Topic] will show the text of a "new topic template" specified by a hidden field.
Spinning that further, we could even extend it with a user definable regex rule, i.e. when you create a new topic that ends in
*StatusReport it will bring up automatically the text of the status report template...
Related:
TemplateTopic
--
PeterThoeny - 13 Feb 2001
Just to reply to your nice comment in
TemplateTopic 
yes, Yes, YES

I have spent quite a bit of time wondering why we have .tmpl files when everything could be a
WikiPage
--
SvenDowideit (insane
WikiPerson) - 18 Feb 2001
I converted the content templates to topics, this is to make editing of those templates easier and to separate them from layout templates.
Done: Removed the
notext.tmpl,
notwiki.tmpl and
notedited.tmpl templates from
TWikiAlphaRelease and added these new topics in the
TWiki06x01 web:
If you want to upgrade your Alpha installation you need to get the three topics from the TWiki.org site. You also need to create a WebTopicEditTemplate topic in each web that has a category table, i.e. see
Know.WebTopicEditTemplate.
It is also possible to specify a specific topic name as a template when creating a new topic:
Above form asks for a topic name. A hidden input tag of name "templatetopic" specifies the
ExampleTopicTemplate as the template topic.
See
TWikiTemplates for details.
Question: The existing "template overloading per topic" feature is now redundant, i.e. using the
edit.new.tmpl template when you specify
bin/edit/Test?topic=new. Any objections to removing that feature? (KISS!)
--
PeterThoeny - 08 Jun 2001
In
CategorySearchForm I realized a small problem with the new solution:
The % WIKIUSER... % Variable does not get expanded at creation
time as with the old template mechanism.
So it's useless/confusing, to put that into the
ExampleTopicTemplate.
Another thing:
you'd probably want to apply access control on templates.
Now, if you have "Set ALLOWTOPICHANGE = your template admins"
in your template,
don't you have to delete this everytime you create a new topic?
Otherwise, you could lock out yourself, right?
--
PeterKlausner - 09 Jun 2001
I just fixed
SignaturesNotWorking (
%WIKIUSER% not expanding), the bug was introduced just at TWiki.org, not in the
TWikiAlphaRelease.
Access control is a good point. Yes, you'd lock yourself out. A workaround is to place the template in a protected web. Any better idea?
--
PeterThoeny - 09 Jun 2001
Sorry, this a newbie question, I fear I didn't understand everything ! but does this means I can associate a template with a
TopicClassification with this ? I mean, can I have have a template for
FeatureToDo, or
FeatureBrainstorming for instance ? which I don't have in the December release ?
--
KhalidHASSANI - 10 Jun 2001
I'd go with getting rid of the "template overloading per topic".
On security, I think this again points to how
MultiLevelWikiWebs would be useful.
--
JohnTalintyre - 11 Jun 2001
The first two new *Template topics appear to be missing. Also, perhaps we should start a new topic on steps to upgrade to the new version. Also, it might be worth having code that will check for the presence of the above at run time, giving a suitable error message if they are missing.
--
JohnTalintyre - 13 Jun 2001
Ignore the above, I think I turned my brain off
--
JohnTalintyre - 13 Jun 2001
See
DynamicEditTopicTemplate for a proposed change of
WebTopicViewTemplate and
WebTopicNonWikiTemplate,
which allows you to select templates conveniently.
--
PeterKlausner - 04 May 2003
PeterKlausner said:
- In CategorySearchForm I realized a small problem with the new solution: The % WIKIUSER... % Variable does not get expanded at creation time as with the old template mechanism. So it's useless/confusing, to put that into the ExampleTopicTemplate.
Is there a way around this problem? I need to evaluate them. Perhaps the default should be to evaluate and have a syntax to escape the evaluation?
--
MartinCleaver - 04 Jun 2003