create new tag
, view all tags
You can put a form on a TWiki page to automatically create another TWiki page. Youu have some control over things like which template is used, what page is the parent, and so forth. This is documented, IIRC, on TWiki.TWikiTemplates (and other pages).

I had some trouble accomplishing this for the CFK Event Schedule on the CFK TWiki, and am recording some of my notes here. (Note that TWiki is an older version, IIRC, it uses the release before Beijing (Athens ??).

See also HTML Forms




Bullet List of Problems

  • %INTURLENCODE{"Wikilearn"}% doesn't work in Athens — replaced %INTURLENCODE{"Wikilearn"}% with %WEB% which seems to work OK in Mozilla (Mandrake 9.0) and IE 5.5.

  • I wanted to insert some delimiters in the created page name to make the date more readable, i.e., instead of EvTD20030512CoreTraining, I wanted to have something like EvTD2003_05_12CoreTraining. Ran into a few problems finding delimiters that would work as:
    • Valid filenames in Windows and Linux — !, (, ), +, =, . and <alt>255 passed this test; @, `, #, $, %, ^, &, * did not (I tested ~ also, and it passed either this test or the next but not both)
    • Valid filenames in TWiki — even though !, (, ), +, =, . and <alt>255 passed the previous test, when I plugged them into the code for the TWiki (HTML?, CGI?)) form to create the page, they were not recognized by TWiki in that the "Page not found" "oops" template came up, asking if I wanted to create the page — if I said yes it did not use the template I specified.
    • There was probably another problem (earlier) but it turned out to be irrelevant — when I chose names that TWiki did not recognize as file names I tried setting the requirement for valid wiki names to off, but, even doing so, the page asking if I wanted to create the page came up and the template I specified was not used.

  • I also wanted to break the file (name) creation into three parts — I thought if the user separately specified the year, month, and day, he would:
    • more clearly understand what was going on
    • more easily see the numbers (because of the small type used within the text box)
    • <something else?>
Anyway, although my false start is shown below, I don't know of a way forward. Maybe if I understood forms better I could collect those three pieces of info, direct them to an intermediate page (using the form action="" parameter), and then on that page concatenate them into the desired page name and create the page. Anyway, something to learn someday.

"Raw" "Attempts" from CFK Event Schedule on the CFK TWiki

Automatic creation of events UNDER CONSTRUCTION:

%INTURLENCODE{"Wikilearn"}% renders as Wikilearn
%WEB% renders as Wikilearn

To schedule a new event, change the date of the scheduled event in the appropriate text box (CoreTraining, WorkParty, BoardMeeting, Distribution, ...) using a format like 2003m05d08:

  • CoreTraining change the date (date format is YYYYxMMxDD)

Very preliminary attempt to request year from user and then set %SYEAR% to that value (to let user set year, month, date — may be easier than changing the date as described above>:

   * Set SYEAR = <form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%/"><input type="text" name="topic" value="%SERVERTIME{$year}%" size="40" /><input type="submit" value="Create" /></form>

The form code for the create CoreTraining event:

<form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%/">
   * <nop>CoreTraining *change the date*
     <input type="text" name="topic" value="EvT%SERVERTIME{$yearm$mod$day}%CoreTraining" size="40" />
     <input type="hidden" name="templatetopic" value="SEvT20030510CoreTraining" />
     <input type="hidden" name="topicparent" value="%TOPIC%" />
     <input type="hidden" name="onlywikiname" value="on" />
     <input type="submit" value="Create" />
     (date format is <nop>YYYYxMMxDD)


  • () RandyKramer - 05 May 2003
  • If you edit this page: add your name here; move this to the next line; and if you've used a comment marker (your initials in parenthesis), include it before your WikiName.

Page Ratings

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2005-03-12 - MeredithLesly
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look