With this patch each topic can have its own template. wiki::readTemplate() has been modified to search for the following templates (in this order):
- $templateDir/$webName/$name.$topic.tmpl
- $templateDir/$webName/$name.tmpl
- $templateDir/$name.$topic.tmpl
- $templateDir/$name.tmpl
$name is the name of the script, for example
view . The current TWiki version uses steps 2 and 4.
This enhancement gives you lots of flexibility to use 'normal' topics for special (systems) functions, especially with the new & improved inline search.
Another example is a separate page for creating new topics;
bin/edit/Test?topic=new uses
edit.new.tmp which has an entryfield for the new topicname in addition to the textbox.
I'm using this feature for the
edit and
view scripts, so the relevant wiki::readTemplate() call in those files has been changed (additional argument). It's perfectly fine to keep calling wiki::readTemplate() with only one argument since the new argument defaults to an empty string, thus behaving just like before (only step 2 and 4, see above).
This patch is almost a necessity if one plans to use the also proposed
TopicDropdownbox.
related links:
InterfaceClutter
--
PeterFokkinga - 15 May 2000
Commited to cvs on 22 May 2000 NZST.
--
NicholasLee - 21 May 2000
Modified status to "done" -- this feature is in the Dec 2000 release, and it really works well.
--
StanleyKnutson - 26 Jan 2002