Tags:
create new tag
view all tags

SID-00954: Topic as template in another topic

Status: Unanswered 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. frown 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

      Change status to:
ALERT! 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.
SupportForm
Status Unanswered
Title Topic as template in another topic
SupportCategory CategoryPlugins
TWiki version 5.0.0
Server OS Linux 2.6.18-53.el5 (i386-linux-thread-multi)
Web server Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel
Perl version 5.008008 (linux)
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2010-10-06 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.