PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Conditional Shortcode Deluxe

  1. Hej.

    thanks for creating Conditional Shortcode. i would like to have 2 or more conditions in a shortcode. how would i do that?

    Example 1:

    'IF emailadress CONTAINS "hotmail.com" OR "live.com" OR "yahoo.com" SHOW ...'

    Example 2:

    How would i do IF ELSE Conditions like

    'IF emailadress CONTAINS "hotmail.com" OR "live.com" SHOW ... ELSE SHOW ...'

    Here is what i am trying to do: Depending on the emailadresses, i want to show different email messages. The problem is just if a condition doesnt apply, it would still show the other message. Thats why the IF ELSE idea. How would thatt work? Maybe you could provide more examples on http://www.gravityhelp.com/documentation/page/Shortcodes#Conditional_Shortcode

    Posted 9 years ago on Friday May 11, 2012 | Permalink
  2. David Peralty

    So your problem is two fold: conditional shortcodes weren't set up to detect part of a field, and so it wouldn't be able to test against half an e-mail address and secondly we haven't set it up for if/else statements yet. You would have to customize Gravity Forms to do what you are asking using some JQuery that is above my current skill level.

    Posted 9 years ago on Friday May 11, 2012 | Permalink
  3. hej david, you underestimate your tool. it actually worked like a charm ;-)

    [gravityforms action="conditional" merge_tag="{Number:1}" condition="contains" value="hotmail"]
    show reply to hotmail adresses
    [/gravityforms]

    the thing is that i would like to use more conditions, similar to what can do right now in the form editor.

    a really nice extension would be a value "CONTAINS_NOT" or ELSE... so you can really make nice notifications mails. or is it possible to use that already.? the documentation is kinda uncomplete on your website ;-)

    Posted 9 years ago on Wednesday May 16, 2012 | Permalink
  4. "a really nice extension would be a value "CONTAINS_NOT" or ELSE... so you can really make nice notifications mails. or is it possible to use that already.? the documentation is kinda uncomplete on your website ;-)"

    +1

    Mark

    Posted 9 years ago on Wednesday May 16, 2012 | Permalink
  5. would like to push this a little up in your mind again ;-)

    Posted 9 years ago on Monday May 21, 2012 | Permalink
  6. David Peralty

    Sorry, there isn't a negative of contains, and we don't support and if/else logic currently in the conditional shortcodes.

    Posted 9 years ago on Monday May 21, 2012 | Permalink