This question about Configuration: Answered
IF Topic = empty
Hello,
I'm working on a wiki which is taking its data only from Formfields, but the main body is still used sometimes. If the Text field remains empty, it doesn't show anything anyway, so no problem, but IF it has data, I want to add a title to it. That means that I need to tell the ViewTemplate "if TEXT is empty, do nothing, but otherwise add a title to it".
I know how to display things based on the contents of the formfields:
IF Formfield(...) = "nothing" THEN "<nop>" etc
but how can I write a phrase like
IF %TEXT% is = "empty" THEN "<nop>" ?
*EDIT:*
I found out that the following can work, but still it does not show my %TEXT% properly:
%IF{"'%TOPIC%'/lc(text)~''" then="<nop>" else="---+++Title
%TEXT%"}%
What have I missed here?
*EDIT 2:*
I found a workaround; it's not a solution, but it works for me as for now. This basically still shows the TEXT, but since it's empty anyway, it's not a problem. I'll leave this here just in case anyone needs it:
%IF{"'%TOPIC%'/lc(text)~''" then="<nop>" else="---+++Title"}%
%TEXT%
--
LieVen - 03 Sep 2019
Try this:
%IF{"'%TOPIC%'/text=~'^\s*$'" then="is empty" else="is NOT empty"}%
--
MichaelDaum - 03 Sep 2019