Hackbard
Hackbard

Reputation: 450

modX If Statement return nothing

I want to write only output if needed, but it returns nothing. No a and no b.

[[+mobilephone]] <- not empty
[[!If? &subject=`[[+mobilephone]]` &operator=`notempty` &then=`a` &else=`b`]]

maybe you have an idea. My Context is a Site which called a Snippet which call a Chunk.

Version Info:

MODX Revolution 2.2.10-pl (sdk)

Upvotes: 0

Views: 395

Answers (2)

OptimusCrime
OptimusCrime

Reputation: 14863

You could try with normal output modifiers:

[[+mobilephone:notempty=`a`:else=`b`]]

Upvotes: 2

Adrian
Adrian

Reputation: 3306

You seem to be missing the & from subject i.e. try

[[!If? &subject=`[[+mobilephone]]` &operator=`notempty` &then=`a` &else=`b`]]

Upvotes: 0

Related Questions