I've been trying to allow users to create new topics based upon a combination of:
- An embedded HTML form that calls the edit script using "action=form"
- A topic Form template
- A topic view template, and
- A topic content template
The idea here is to stick to HTML forms and buttons, without having people need to press the edit button. It's for a sort of meeting database into which people can add meeting notes or meeting actions.I'm using the
CommentPlugin to create meeting notes and actions.
- The view template has the COMMENT forms in it
- The template topic has anchors, into which the COMMENTS (actions or notes) are attached
Anyway, the problem is that if you call "edit" with "action=form" as follows:
<form action='%SCRIPTURLPATH{"edit"}%/%BASEWEB%/ContactReportAUTOINC0001' name="createContactReport">
%MAKETEXT{"Create a new contact report by clicking"}%
<input type="hidden" name="t" value="%SERVERTIME{$hou$min$sec}%" />
<input type="hidden" name="templatetopic" value="%WEB%.ContactReportTemplate" />
<input type="hidden" name="parenttopic" value="%WEB%.ContactReports" />
<input type="hidden" name="action" value="form" />
<input type="submit" class="twikiSubmit" value='%MAKETEXT{"Create New Contact Report"}%' />
</form>
Using pattern skin, then the content of
ContactReportTemplate isn't getting copied into the the topic body when it's created.
I've fixed it using the following moified
editform.tmpl, but I'm not sure if it's a sound change.
%{ This is a default template }%%TMPL:INCLUDE{"edit"}%
%TMPL:DEF{"focus"}%%TMPL:END%
%TMPL:DEF{"titleaction"}%%MAKETEXT{"(edit form)"}% %TMPL:END%
%TMPL:DEF{"pagetitle"}%<nop>%TOPIC% %MAKETEXT{"(edit form)"}%%TMPL:END%
%TMPL:DEF{"footernote"}% %TMPL:END%
%TMPL:DEF{"content"}%%TMPL:P{"formstart"}%%TMPL:P{"formbottom"}%
<input type="hidden" id="topic" name="text" value="%TEXT%" />
%TMPL:P{"topicinfo"}%
%TMPL:P{"formend"}%%TMPL:END
Have I got this right?
Can we get this, and possibly similar changes, rolled into the next release?
--
TWiki:Main/GrantTraynor - 09 May 2008
This has been noted in
Item5547.
--
TWiki:Main.ArthurClemens - 10 May 2008