We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Codev Web>UniqueTopicTemplates (03 Nov 2004, RafaelAlvarez)
Tags:
create new tag
, view all tags
With this patch each topic can have its own template. wiki::readTemplate() has been modified to search for the following templates (in this order):
  1. $templateDir/$webName/$name.$topic.tmpl
  2. $templateDir/$webName/$name.tmpl
  3. $templateDir/$name.$topic.tmpl
  4. $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

Topic attachments
I Attachment Action Size Date Who Comment
elsediff edit.diff manage 0.6 K 15 May 2000 - 20:54 PeterFokkinga diff against 20000501 release
elsediff view.diff manage 0.6 K 15 May 2000 - 20:53 PeterFokkinga diff against 20000501 release
elsediff wiki.pm.diff manage 1.3 K 15 May 2000 - 20:53 PeterFokkinga diff against 20000501 release
Topic revision: r5 - 03 Nov 2004 - 19:34:19 - RafaelAlvarez
Codev.UniqueTopicTemplates moved from Plugins.UniqueTopicTemplates on 03 Nov 2004 - 19:33 by RafaelAlvarez - put it back
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback