Question
I'm try to create a master document that will include other sub documents if they exists, or have a button to create them if they don't.
(I'm doing this because I can't create the whole trree of documents in one go.)
The point I started off from was based on
PeterThoeny's answer to
LynnwoodBrown's question at
ConditionalDisplayInTemplate
%CALC{"$IF($EXISTS(%TOPIC%Consequences),$NOP(%)INCLUDE{%TOPIC%Consequences}$NOP(%),$NOP(%)TOPIC$NOP(%)Consequences does not exist)"}%
Which doesn't seem to work as I expect. It says the topic dons't exist but it does. Am I short a few NOP's?
Support/ConditionalDisplayInTemplate
The next jump would be to a form with a button that created the relevant topic:
%CALC{"$IF($EXISTS(%TOPIC%Consequences),$NOP(%)INCLUDE{%TOPIC%Consequences}$NOP(%), <div style='float:right'> <form name='new' action='$NOP(%)SCRIPTURL$NOP(%)/edit$NOP(%)SCRIPTSUFFIX$NOP(%)/$NOP(%)WEB$NOP(%)/> <table> <tr> <td align='right'> <INPUT type='submit' value='Create Consequences'> <INPUT type='hidden' name='TopicType' value='Consequences'> <INPUT type='hidden' name='templatetopic' value='ConsequencesTemplate'> <INPUT type='hidden' name='parent' value='$NOP(%)TOPIC$NOP(%)'> </td> </tr> </table> <form> </div>)"}%
However this produces a file called
> <td...
.....
Environment
--
AntonAylward - 02 Aug 2005
Answer
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.
It seems that some functions behave differntly between Cairo and Dakar - see
http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item190
--
AntonAylward - 03 Aug 2005