SID-02344: varFORM and $formweb
| Status: |
Answered |
TWiki version: |
6.0.2 |
Perl version: |
|
| Category: |
CategoryDocumentation |
Server OS: |
|
Last update: |
7 years ago |
Is var %FORM% still working in TWiki 6.0.2?
%FORM{format="$formweb"}% or
%FORM{format="$formtopic"}% doesn't seem to work.
I can use
%FORMFIELD{"name" format="$formtopic"}% to retrieve the name of the topic containing the form definition, but
%FORMFIELD% doesn't support
$formweb, so when the form is on another web, I will get a link which is not working.
--
Emiel Van Riel - 2018-02-05
Discussion and Answer
Hm.... According to the source, it seems that
$formweb never has worked when the form and topic are in the same web, but you use the form variable from another web. The symptom is that
$formweb is expanded to the web where you use the
%FORM% variable - is that correct?
If so, then You seem to have found a (yet another) bug. I'll attach the trivial fix. Do you want to file a bug report or should I do it myself?
BTW: If form and topic are in different webs, or if the topic using the form and the topic using the
%FORM% variable are in the same web, it's ok.
--
Harald Jörg - 2018-02-05
Harald, since I'm not a programming expert and I even don't know where to look in the source, as you did, it seems best that you make a bug report.
In my TWiki %FORM% isn't expanded at all. That is why I was asking if %FORM% is still working in TWiki 6.0.2.
Thanks for answering my question.
--
Emiel Van Riel - 2018-02-05
Hello Emiel,
if
%FORM% isn't expanded at all, then perhaps you didn't specify a topic which
uses a form? In that case, there's just an empty output and no error message. I'm writing that because this is the error I made when I first tried it: for the
topic parameter I specified the name of the
form, which is just wrong.
Just let me try here with our previous experiment in
SID02334DemoTopic:
%FORM{topic="Sandbox.SID02334DemoTopic" header="on" formfields="all"}%
Renders as:
| MyForm |
| Title: |
Demonstrating a custom view for topics containing a special form |
| Summary: |
TWiki allows every application author to define the appearance of the application's form data. |
| Docnumber: |
Demo-02334 |
| Author: |
Emiel van Riel (content); Harald Jörg (demo) |
| Status: |
Draft |
Oh, drats. It doesn't render at all: twiki.org doesn't run 6.0.2 yet: The FORM variable didn't exist in previous versions.
--
Harald Jörg - 2018-02-05
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.