Need help w/ conditional for ALL TRUE

Options
Hey there, I built out this conditional it seemed to be working, but I realized it is evaluating to 'true' even when all conditions aren't met.


The logic is supposed to check to see if a user is a member of a group, by group ID. If they are a member of ALL groups, show content. If not, don't show anything.


For the purpose of sharing this, I replaced my real content with 'true_content' and no content with 'false_content' ... any help would be v appreciated. LMK, thanks! -c


Original code:

[[?

[[?[[S45:92374]]::TRUE::T::]]

[[?[[S45:94381]]::TRUE::T::]]

[[?[[S45:94380]]::TRUE::T::]]

[[?[[S45:94379]]::TRUE::T::]]

::T:: true_content

:: false_content

]]


Help?
Tagged:

Comments

  • There are two ways you can go about this.


    You could reverse the conditional to test for a false value:


    [[?

      [[?[[S45:92374]]::TRUE::::F]]

      [[?[[S45:94381]]::TRUE::::F]]

      [[?[[S45:94380]]::TRUE::::F]]

      [[?[[S45:94379]]::TRUE::::F]]

    ::F::

      false_content

    ::

      true_content

    ]]


    Or you could chain all of your TRUE statements together:


    [[?xTRUExTRUExTRUExTRUEx::x[[S45:92374]]x[[S45:94381]]x[[S45:94380]]x[[S45:94379]]x::

      true_content

    ::

      false_content

    ]]
  • Thanks Noah! That totally worked (I opted for stringing them all together, 2nd option). Ahhhh. Thanks again. -c

Categories