• Hi, how do I compare a variable or PASS that contains the query string against the value of the field ID.

    Basically, I want to add a class that will indicate the active panel selection so I can style it with CSS.

    I understand how to get the query string ie ?solution=2 into a variable or pass it.

    I understand how to get the field ID.

    But I do not know how to compare a pass or variable to a field.

    The documentation seems to indicate the compare won’t work for these types.

    Thanks for the awesome plugin and eagerly awaiting your reply!

Viewing 3 replies - 1 through 3 (of 3 total)
  • [pass field=id]
    [if var=myquery value='{FIELD}']
      Do what you want
    [/if]
    [/pass]

    or

    [pass vars]
    [if field=id value='{MYQUERY}']
      Do what you want
    [/if]
    [/pass]
    • This reply was modified 3 years, 10 months ago by polarracing.
    • This reply was modified 3 years, 10 months ago by polarracing.
    Thread Starter markofapproval

    (@markofapproval)

    Hi, and thank you for your replay.

    However, I was referring to an if statement comparing two passes like:

    [if pass_1={FIELD1} pass_2={FIELD} compare]

    Aside from using the math module and assigning them all to a flag, I could code a simple shortcode and share a link here to the gist if you want.

    If you are passing two fields, try:

    [if pass={FIELD1} value='{FIELD}']

    • This reply was modified 3 years, 10 months ago by polarracing.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Comparing two variables’ is closed to new replies.