SID-00954: Topic as template in another topic
| Status: |
Unanswered |
TWiki version: |
5.0.0 |
Perl version: |
5.008008 (linux) |
| Category: |
CategoryPlugins |
Server OS: |
Linux 2.6.18-53.el5 (i386-linux-thread-multi) |
Last update: |
15 years ago |
I want to use a topic as a template for another topic. This is a overly simplified problem statement.
The template topic has an arbitrary number of child topics. The template may have any number of child topics, 1 to 999+ child topics.
Say the mother topic is called Mother0001. And all the child topics are called
Mother0001Child0001,
Mother0001Child0002 etc.
I want use Mother0001 as template for Mother0002 and
Mother0001Child0001 as template for
Mother0002Child0001 etc.
I tried using %TOPICCREATE{}% in the following manner:
%TOPICCREATE{template="Mother0001" topic="MotherAUTOINC0001?"}% but that doesn't work. Seems like the AUTOINC part doesn't work.
To create the child topics I tried the following:
<verbatim>
%SEARCH{ "Mother0001Child*" web="%WEB%" excludetopic="" scope="topic" type="regex" order="topic" limit="1" nonoise="on" nototal="on" format="$percntTOPICCREATE{template=\"$dollartopic\" topic=\"Mother0002$dollartopic\" }$percnt"}%
</verbatim>
But that doesn't work either.
Any ideas? or am i barking up the wrong tree?
--
HenroRitchie - 2010-08-26
Discussion and Answer
After thinking about it a trying to figure out what is going wrong I realized that the %TOPICCREATE{}% var is removed once the topic is saved, so I cannot re-use it.

Any Idea how to workaround it?
--
HenroRitchie - 2010-08-28
An update - I decided to use the following code to try and create multiple topics at once.
%FOR{"count" start="1" stop="50" step="1"}%
%TOPICCREATE{template="TopicTemplate" topic="%NAME%"}%
%NEXT{"count"}%
This still doesn't work and after examining the %TOPICCREATE% perl module i I saw there is no provision for META data which is what I need.
How would I go about fixing this problem?
--
HenroRitchie - 2010-08-28
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
PeterThoeny - 2010-10-06
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.