Tags:
create new tag
view all tags

Question

I read TWikiTemplates and it looks to be exactly what I want - create a new page using the content of another , "template", page as the default text of the new topic.

I created my template page. I set up the form. I clicked the button. The new page was created using WebTopicEditTemplate as the basis and ignoring my template.

I reread the docs, decided that I needed to put my template into the TWiki web (bad), did so, tried again. Still no luck.

Here's my form code:

<form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%INTURLENCODE{"%WEB%"}%/">
   * New example topic: 
     <input type="text" name="topic" value="MediaOpsPropertyDeployment%SERVERTIME{$yearx$mox$day}%" size="50 />
     <input type="hidden" name="templatetopic" value="MediaOpsPropertyDeploymentTemplate" />
     <input type="hidden" name="topicparent" value="MediaOps" />
     <input type="hidden" name="onlywikiname" value="on" />
     <input type="hidden" name="onlynewtopic" value="on" />
     <input type="submit" value="Create" />
     (date format is <nop>YYYYxMMxDD)
</form>

My template topic is at

TWiki.MediaOpsPropertyDeploymentTemplate
on our server. It's ignored.

Not mentioined in the original possting, I have an identical topic at

MediaOpsPropertyDeploymentTemplate
in the current web. It's also ignored.

What am I doing wrong?

Environment

TWiki version: 03 Sep 2004 $Rev: 1742 $
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories:  

-- VickiBrown - 06 Sep 2006, 13 Sep 2006 (updated)

Answer

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.

Sice you are specifying %WEB% in the form action, you should put the template topic in the web where the form is. Then, the <input type="hidden" name="templatetopic" value="MediaOpsPropertyDeploymentTemplate" /> should work properly. See (and view raw) also the Sandbox.MeetingMinutes application that creates new topics based on a template topic.

-- PeterThoeny - 09 Sep 2006

I had the template in the same web before I reread the docs that implied it shoudl go into the TWiki web. That didn't (and still doesn't) work eithert.

-- VickiBrown - 13 Sep 2006

Perhaps there was a bug in the Cairo release? (sadly, that's what the COmpany is using)

-- VickiBrown - 13 Sep 2006

This was definitely working in Cairo. How about including the web location of your template? i.e.: <input type="hidden" name="templatetopic" value="TWiki.MediaOpsPropertyDeploymentTemplate" /> Of course, double, double-check topics names and such.

-- LynnwoodBrown - 13 Sep 2006

While trying to trouble-shoot a very similar problem with SaveScriptNotUsingTemplateTopic, I found this piece that may be the solution to your problem as well: remove the forward slash after %INTURLENCODE{"%WEB%"}% in the action attribute.

-- LynnwoodBrown - 13 Sep 2006

Try removing these two lines:

     <input type="hidden" name="onlywikiname" value="on" />
     <input type="hidden" name="onlynewtopic" value="on" />

-- LynnwoodBrown - 14 Sep 2006

How about including the web location of your template?

Again not mentioned above, this was also tried (and failed) during the various attempts to troubleshoot.

remove the forward slash

didn't help. Neither did the suggestion to remove the next two lines. And I tested my templatetopic string. It's valid.

Current code (more generic; still failing)

<form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%INTURLENCODE{"%WEB%"}%">
   * New example topic: 
     <input type="text" name="topic" value="%TOPIC%%SERVERTIME{$yearx$mox$day}%" size="50 />
     <input type="hidden" name="templatetopic" value="%WEB%.%TOPIC%Template" />
     <input type="hidden" name="topicparent" value="%TOPIC%" />
     <input type="hidden" name="onlynewtopic" value="on" />
     <input type="submit" value="Create" />
     (date format is <nop>YYYYxMMxDD)
templatetopic : [[%WEB%.%TOPIC%Template]]
 </form>

-- VickiBrown - 14 Sep 2006

Very small thing and I don't see how this could be the problem, but there's a missing double-quote after "50" in the 3rd line. But otherwise, I'm afraid I'm stumped. This should work. frown

-- LynnwoodBrown - 15 Sep 2006

The smallest bugs have the sharpest teeth.

Thank you that second pair of eyes. It works now.

-- VickiBrown - 15 Sep 2006

Change status to:
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2006-09-15 - VickiBrown
 
  • 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.