Tags:
create new tag
view all tags

Question

Our typical twiki user is twiki literate to the point of being able to formulate a twiki word, change font styles, and perhaps create a link, but he does not need to understand twiki commands to do his job. We have a page that contains a form with one field for a new topic name and a submit button. The code under the button (below) creates a new topic based on a template (ProyectoTATemplate) which contains more than 50 lines of code. The user enters the topic name, clicks the button and is confronted with the 50 lines of code. He is not sure how to proceed (we have the odd 'she' in the same situation).
action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%/">
<input type="text" name="topic" size="15" />
<input type="hidden" name="onlywikiname" value="off" />
<input type="hidden" name="templatetopic" value="ProyectoTATemplate2" />
<input type="hidden" name="topicparent" value="%TOPIC%" />
<input type="hidden" name="onlynewtopic" value="true" />
<input type="submit" class="twikiSubmit" value=" Submit "/ >
</form></font> 

For the scenario to work correctly, the user has to realise he has to click on Save in order to save the new topic, but it is not clear that this is what is expected of him. When the user clicks the Submit button, is it possible to programatically save the new topic, such that the next thing he sees is the saved topic, in 'view' mode? Or would it be possible to just hide the code pulled from the template? I tried using the INCLUDE statement, it unexpectedly replaced itself with the included code on topic save, This does not look pretty, but worse, it creates a maintainablity problem when the time comes to modify the template. To fix the topics already created with the template, I have to open them one by one and do a load of copy pasting. Please tell me I'm doing something wrong smile Any help would be appreciated. Ralph

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: HP-UX
Web server: Apache
Perl version: 5
Client OS: WinXP
Web Browser: IExplorer
Categories: Forms, Missing functionality

-- RalphEllison - 10 Dec 2007

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.

Sure. Your current form action is edit. Change it to save and you are set. (And I would change the submit button label to "Create")

-- ArthurClemens - 10 Dec 2007

Thanks Arthur, that's just what I needed! Regarding INCLUDE, is there some way one can include code into the current topic from another topic without physically pulling the code into the current topic?

-- RalphEllison - 11 Dec 2007

  • Use INCLUDE if that code won't be changed. You can do this in the topic, or by using a special VIEW_TEMPLATE that includes the content before or after the topic text.
  • Use a TWikiForms for structured data. Any changes to the external form table will be visible only after editing/saving the topic.

-- ArthurClemens - 11 Dec 2007

The code may change in the future, so perhaps a template might help. thanks again, Arthur

-- RalphEllison - 11 Dec 2007

Change status to:
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2007-12-11 - RalphEllison
 
  • 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.