SID-01856: Displaying a topic's parent formfield data
| Status: |
Answered |
TWiki version: |
5.0.2 |
Perl version: |
5.8.8 |
| Category: |
CategoryForms |
Server OS: |
Red Hat Linux |
Last update: |
12 years ago |
I'm trying to display formfield data from a topic's parent. I found this topic from 2005:
VariableInFormField
One of the last comments was that this should work in the Dakar release.
This is what I have tried:
%FORMFIELD{"Title" topic="%META{"parent" dontrecurse="on"}%"}%
%FORMFIELD{"Title" topic="%PARENTTOPIC%"}% (turns out PARENTTOPIC isn't available on TWiki 5.0.2)
If I explicitly put the topic name in it works:
%FORMFIELD{"Title" topic="MyParentTopic"}%
--
Joshua Tharp - 2014-01-13
Discussion and Answer
If you use %META you likely need to specify the format and topic parameter. Details in
VarMETA.
--
Peter Thoeny - 2014-01-13
Thanks, Peter!
For future searchers...
%FORMFIELD{"Title" topic="%META{"parent" dontrecurse="on" format="$topic"}%"}%
The format term is required because otherwise the %META% variable returns the parent in the form
[[$web.$parent][$parent]]
--
Joshua Tharp - 2014-01-13
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.