SID-00058: Edit Template and Edit Custom
| Status: |
Answered |
TWiki version: |
4.2.4 |
Perl version: |
|
| Category: |
CategoryForms |
Server OS: |
|
Last update: |
17 years ago |
Hello everybody,
I need help on how to do a “Custom EDIT” and a “Custom VIEW”…
The thing is that I found a way to develop a html form for Twiki, in which you first create a regular twiki form, then you create a topic in which you call all fields from the form with the variable FORMFIELD… all this is already done and it works, but I uderstad that for all this to be effective I need to do a custom EDIT and a custom VIEW… so I think that this refers to the twiki files "edit.tmpl", "edit.pattern.tmpl", "view.tmpl", "view.classic.tmpl"… if this is the case, I would like to know how to create my own edit.tmpl but with a different name so I can be able to call it from only specific webs.
Thank you
--
MartyReal - 27 Jan 2009
Discussion and Answer
I dont think you need to create a template for that. You can use a html form inside de topic with the action on the save script. As long as you match the names of the inputs with the names of the fields it will save the values to your topic when submitted. Set the initial values of the html form with the FORMFIELD variable.
A cleanner approach would be to create a topic with this html form (e.g.
EditFormValues) and in the FORMFIELD calls set
topic="%URLPARAM{"editedtopic"}%. So you can use this page to edit any topic with form field values passing the topic name in the editedtopic parameter. You can use in every topic an edit-this-topic link like this
[[%SCRIPTURL{view}%/%BASEWEB%/EditFormValues?editedtopic=%TOPIC%][Edit this topic]]
or include the html form in the topic
%INCLUDE{"EditFormValues" editedtopic="%TOPIC%" }%
That way you can make future changes to your form in
EditFormValues wich will be reflected in every topic.
--
EnriqueCadalso - 04 Feb 2009
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.