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

Any help would be appreciated.
Ralph
Environment
--
RalphEllison - 10 Dec 2007
Answer
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