This question about Topic Markup Language and applications: Answered
Conditional include - best practices
I need to include other topics conditionally - if this is intended by user who wrote an article.
I resolved it as follows.
In my template I have attached
DataForm with following field:
| dispGlobal | checkbox | 1 | YesChecked | | |
and then I use in my
view template:
This works properly.
However, I wonder if this is the best practice/suggested solution.
What if I need to display particular text if
any of the three checkboxes in my
DataForm is checked?
Condition will be quite long and error prone.
If am correct, it will be:
%IF{"'%FORMFIELD{"dispGlobal"}%'='YesChecked' or '%FORMFIELD{"secondCheckbox"}%'='YesChecked' or '%FORMFIELD{"thirdCheckbox"}%'='YesChecked'" then="Any text or include"}%
--
MateuszKDzior - 06 Nov 2015
I think your solution is fine. Why do you suggest that it is error prone? If the values are as simple as you present above, you could conceivably simplify the condition as follows
%IF{"'%FORMFIELD{"dispGlobal"}%%FORMFIELD{"secondCheckbox"}%%FORMFIELD{"thirdCheckbox"}%'~'*YesChecked*'" then="Any text or include"}%
--
LynnwoodBrown - 16 Nov 2015