We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11351
    • 16 Posts
    Hi,

    Im trying to do some check condition on a login page via iF add on but I seem to have a problem when the else output is run:
    [[!If? &subject=`[[+modx.user.username]]` &operator=`EQ` &operand=`(anonymous)` &then=`[[!Login? &tplType=`modChunk` &loginResourceId=`46` &loginTpl=`lgnLoginTpl` ]]` &else=`[[!Redirect=`10`]]` ]]

    It doesnt seem to redirect. Alot of the times the user might be logged in but will land on the login page I would like to redirect them to the users page.

    Any thoughts?

    Regards,
    Nick
      • 11351
      • 16 Posts
      Hi,

      Well the problem happens when I add the Redirect to the else:
      [[!If? &subject=`[[+modx.user.username]]` &operator=`EQ` &operand=`(anonymous)` &then=`[[!Login? &tplType=`modChunk` &loginResourceId=`46` &loginTpl=`lgnLoginTpl` ]]` &else=`[[!Redirect? &id=`46`]]` ]]

      It always evaluate to false and runs the else output. When I remove the Redirect and insert a message string it doesnt evaluate wrong and shows the &then output.

      Cant understand why!