Tags:
create new tag
view all tags

SID-00440: How do I edit a topic using a form

Status: Answered Answered TWiki version: 4.0.3 Perl version: 5.x
Category: CategoryEditing Server OS: Redhat Linux Last update: 16 years ago

This is more of an implementation question rather than a problem with TWiki itself.

How would I create a topic page such that a form on that page could edit the page itself. The effect I'm trying to achieve is similar to that with the form editing method of the TWiki preferences. I would like to be able to achieve the same effect but with either free text wrapped in specific identifyers or at worst custom TWiki Variables.

Can anyone help me?

-- JeremyWolstenCroft - 2009-07-27

Discussion and Answer

I did something like that for a change management application: when we click "Edit" on these special topics, we a form of your choosing, instead of the topic editor. But "Save and Continue" takes you through to the topic editor (which can be handy when trouble-shooting your application).

There are three pieces to this:

MyForm:

| *Name* | *Type* | *Size* | *Value* |
| Description | text | 117 | |
| DateOfChange | date | 12 |  |
| ImplementationPlan | textarea | 120x16| |
| TestPlan | textarea | 120x8| |
| BackoutPlan | textarea | 120x4| |

MyTemplate (used to create new topics):

<!--
!!! PREFIX THESE BULLETS WITH THREE SPACES IN THE FINAL VERION. REMOVED THEM HERE TO DISABLE THEIR FUNCTIONALITY!!!
* Set VIEW_TEMPLATE = MyView
* Set EDITACTION = form

Hide the table row above the form that normally lets the user replace the form:
* Set COVER = noreplace
-->

MyViewTemplate:

%TMPL:INCLUDE{"view"}%
%TMPL:DEF{"content"}%%TMPL:P{"toolbar"}%
%TMPL:P{"topicpathinfo"}%%TMPL:P{"beforetext"}%%TMPL:P{"formattop"}%%TMPL:P{"attachmentsattop"}%<div class="patternContent">%TMPL:P{"customdisplay"}%%TMPL:P{"textcontent"}%%TMPL:P{"aftertext"}%%TMPL:P{"formatbottom"}%</div>
%TMPL:END%

%TMPL:DEF{"customdisplay"}%<div class="patternTopic">
---+!! %TOPIC%
| Description | %FORMFIELD{"Description"}% |
| Date of Change | %FORMFIELD{"DateOfChange"}% |
| Time of Change | %FORMFIELD{"TimeOfChange"}% |
etc.
</div>%TMPL:END%

-- SeanCMorgan - 2009-07-27

Very neat, thank you.

-- JeremyWolstenCroft - 2009-07-31

      Change status to:
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.
SupportForm
Status Answered
Title How do I edit a topic using a form
SupportCategory CategoryEditing
TWiki version 4.0.3
Server OS Redhat Linux
Web server Apache
Perl version 5.x
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2009-08-06 - JeremyWolstenCroft
 
  • 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.