-
☆ A M B ☆
- 73 Posts
All of the sudden this code stopped working on 2.2.7 when calling a value of Yes/No from a TV.
[[!If?
&subject=`[[*resource]]`
&operator=`EQ`
&operand=`Yes`
&then=`[[$someChunk]]`
&else=`[[$someOtherChunk]]`
]]
I was however able to make part of it work by doing this:
[[*resource:is=`Yes`:then=`
[[$someChunk]]
`]]
So, was something changed in 2.2.7 or am I taking crazy pills?!?!
-
☆ A M B ☆
- 73 Posts
Well, at least there are multiple ways to do a task.
As long as I got this working - I'm good.
Quote from: exside at Apr 14, 2013, 05:36 PMgood point, you can easily replicate the same behavior like this:
[[[[*resource:is=`Yes`:then=`$someChunk`:else=`$someOtherChunk`]]]]
anyways, I think you should use the :else=`` thing always with :then stuff, had some problems when omitting it...
Exactly, and this has proven to be much, MUCH faster.
Brief explanation on that: MODX parses from the inside out. When you quote `[[$stop]]` and `[[$chunkytime]]`, both chunks are parsed to determine output, wheras now your IF statement simply returns $stop or $chunkytime, which is then parsed via the normal MODX method.
@MarkGHErnst
Developer at Adwise Internetmarketing, the Netherlands.
-
☆ A M B ☆
- 73 Posts
Responses such as these are what make this forum so great. I'm a non-programmer who is learning the basics in order to make MODX do what I want.
Learning to separate with a simple : rather than [[ ]] was new to me.