ChildTopicTemplatePlugin
Specify a template when creating a child topic via red-link
Introduction
This plugin allows you to specify in a topic what template should be used when a child topic is created via TWiki's red-link. A number of different templates can be specified throughout a topic to allow different child topics to be created in different sections of the parent.
Syntax Rules
- Write the command
%CHILDTOPICTEMPLATE{ "NameOfTopicTemplate" }% anywhere in your text.
- All subsequent red-linked WikiWords will be created using the specified topic template.
- Use
%CHILDTOPICTEMPLATE{}% to remove the child topic template.
- A topic can contain any number of CHILDTOPICTEMPLATE commands.
Example
NewTestTopic1 -- this red-link uses the default template topic
%CHILDTOPICTEMPLATE{ "NewTopicTemplate" }% -- set custom template topic NewTopicTemplate
NewTestTopic2 -- this red-link uses template topic NewTopicTemplate
%CHILDTOPICTEMPLATE{}% -- disable custom template topic
NewTestTopic3 -- this red-link uses the default template topic again
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%CHILDTOPICTEMPLATEPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Specify a template when creating a child topic via red-link
- Debug plugin: (See output in
data/debug.txt)
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
ChildTopicTemplatePlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/ChildTopicTemplatePlugin.txt | Plugin topic |
lib/TWiki/Plugins/ChildTopicTemplatePlugin.pm | Plugin Perl module |
- Visit
configure in your TWiki installation, and enable the plugin in the {Plugins} section.
- Test if the installation was successful:
- NewChildTopicTemplateLinkTest1 -- red-link to topic using default template topic
-
%CHILDTOPICTEMPLATE{ "Plugins.ChildTopicTemplatePlugin" }% %CHILDTOPICTEMPLATE{ "Plugins.ChildTopicTemplatePlugin" }%
- NewChildTopicTemplateLinkTest2 -- red-link to topic using "Plugins.ChildTopicTemplatePlugin" as template topic
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins