%TOPICCREATE{}%
TWikiVariable is useful for creating topics based on templates.
%TOPICCREATE{ <attributes> }%
Attribute | Meaning | Valid input | Default![]() |
---|---|---|---|
parent="" | Name of parent topic | Any valid WikiWord | (parent of template topic) |
template="" | Name of TWiki topic to be used as template | Any valid TWiki topic | (required) |
topic="" | Name of new TWiki topic to create | Any valid WikiWord | (required) |
parameters="" | List of parameters to pass to a child topic to initialize any urlparams. | Following syntax:<parameter-name>=<parameter-value> followed by any number of parameter name, value pairs separated by & or ; | No Parameters |
disable="" | Name of the template topic containing this use of TOPICCREATE | Any valid topic name (WikiWord) | recommended |
Save Changes
button in preview.
%TOPICCREATE{}%
variable will be removed upon saving of the topic.
template
will also be copied over to the new topic.
%TOPICCREATE%
is recursive
%TOPICCREATE{ template="MyTemplate" topic="%TOPIC%MyNewTopicName" parameters="MyParameterName=MyParameterValue&Hello=Goodbye" }%
to create a twiki topic based on another topic MyTemplate
with the name %TOPIC%MyNewTopicName
. Any %URLPARAM{}%
with the name MyParameterName
and Hello
present in MyTemplate
will be replaced with MyParameterValue
and Goodbye
.
disable
argument, or escape it: %TOPICCRE%NOP%ATE{...}%
. The %NOP%
gets removed when a topic gets instantiated based on a template.
%TOPICATTACH{ <attributes> }%
Attribute | Meaning | Valid input | Default |
---|---|---|---|
fromtopic="" | Topic (or Web.Topic) that contains the attachment | Any valid TWiki topic | (required) |
fromfile="" | The attachment to copy from | Any attached file from fromtopic | (required) |
disable="" | Name of the template topic containing this use of TOPICATTACH | Any valid topic name (WikiWord) | (required) |
comment="" | Comment to appear for the attachment within this topic, replacing the comment that was in the fromtopic | a one line string | {omit parameter if no change desired} |
%TOPICATTACH{ fromtopic="SourceTopic" fromfile="Sample.jpg" name="Snoopy.jpg" disable="..."}%
to attach Sample.jpg
from topic SourceTopic
as Snoopy.jpg
.
fromtopic
if desired.
fromtopic
can specify a different web if desired. For example TWiki.SomeTemplate
would be valid as a fromtopic
.
disable
parameter with the topic name containing the %TOPICATTACH%
.
TOPICATTACH
must be in the 'top level' topic being saved by a TOPICCREATE
. It can not be in a recursive/subordinate topic invoked by the TOPICCREATE.
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.
TopicCreatePlugin.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
data/TWiki/TopicCreatePlugin.txt | Plugin topic |
lib/TWiki/Plugins/TopicCreatePlugin.pm | Plugin Perl module |
lib/TWiki/Plugins/TopicCreatePlugin/Func.pm | Plugin core functionality |
TestTopicCreate
with this content: %TOPICCREATE{ template="TWiki.WikiWord" topic="%TOPIC%Child" }%
TestTopicCreate
you should get a new topic TestTopicCreateChild
with the content of WikiWord.
Plugin Author: | TWiki:Main.StanleyKnutson![]() ![]() ![]() ![]() |
Copyright: | © 2005-2014 Peter Thoeny; © 2009 Andrew Jones; © 2008-2014 TWiki:TWiki.TWikiContributor ![]() |
License: | GPL (GNU General Public License![]() |
Sponsor: | Alba Power Quality Solutions![]() |
Plugin Version: | 2014-11-07 |
Change History: | |
2014-11-07: | TWikibug:Item7586![]() |
2011-07-13: | TWikibug:Item6725![]() |
25 Oct 2009: | TWikibug:Item6357![]() cp and mkdir , should now work on any OS that TWiki does; removed depreciated API calls -- TWiki:Main.AndrewRJones![]() |
11686 | TWikibug:Item2956![]() |
10613 | TWikibug:Item2473![]() |
7960 | TWikibug:Item1238![]() |
7585 | TWikibug:Item1016![]() ![]() |
21 Nov 2005: | Initial TOPICCATTACH |
30 Apr 2005: | Initial version |
TWiki Dependency: | $TWiki::Plugins::VERSION 1.2 |
CPAN Dependencies: | none |
Other Dependencies: | none |
Perl Version: | 5.008 |
Plugin Benchmark![]() |
GoodStyle nn%, FormattedSearch nn%, TopicCreatePlugin nn% |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/TopicCreatePlugin![]() |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/TopicCreatePluginDev![]() |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/TopicCreatePluginAppraisal![]() |
Related Topics: TWikiPreferences, TWikiPlugins