[pmwiki-users] [fox] only add new page when textarea is not empty

Hans design5 at softflow.co.uk
Tue Mar 9 09:42:00 CST 2010


Tuesday, March 9, 2010, 11:33:11 AM, Hans wrote:

> I ought to include processing of conditionals, so one can add a
> condition inside the (:foxadd ...:) directive.

I released a new fox.php version which lets you use
a if= conditional parameter
inside Fox's special markups (:foxadd ...:), (:foxreplace ...:)
(:foxptv ...:), (:foxcopy ...:), (:foxmail ...:)

If the condition is fullfilled, the target will be set. Otherwise
the target unset, so the parameters added by such markup ignored.

So, for instance, to have no Kommentar page created when field
'kommentar' is empty, add
   if="!equal {$$kommentar} ''"
to the relevant foxadd markup:

(:foxadd if="!equal {$$kommentar} ''" template=VorlageKommentar
    target=Kommentar-{$$SK}-{$$Nummer}_{$$name}:)


  ~Hans




More information about the pmwiki-users mailing list