Events Made Easy Forums How do I … evets_if "or"

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #42748
    Anonymous
    Inactive

    I’m using conditional formatting, and I’d like to use an “or” functionality. I have a line with two attributes, and I’d like to put a <br> tag at the end if and only if either one has a value.

    Here’s what I tried:

    [events_if tag='#ESC_ATT{SPEAKER}'][events_if2 tag='#ESC_ATT{TOPIC}' value=NULL]<br>[/events_if2][/events_if]

    [events_if tag='#ESC_ATT{TOPIC}']<br>[/events_if]

    This logic says:

    Include the if SPEAKER is set but TOPIC is not set (the first if)

    Include the if TOPIC is set (the second if)

    Except it does not work. The second if catches the TOPIC setting just fine, but the first if doesn’t catch the pair of set/not set. If I try setting the value of TOPIC to “” instead of NULL, then it catches every instance of SPEAKER and TOPIC being set, which is not the desired effect. I want SPEAKER and not(TOPIC).

    Is there a way to test for not set?

    Thanks!

    #47604
    Franky
    Keymaster

    The reason is simple: for now you can’t compare to an empty value, the if-structure I wrote ignores it and falls to the default, which is to check if the tag value is not empty.

    I added the possibility to specify “is_empty=1” as condition part in trunk, so your code becomes:

    [events_if tag='#ESC_ATT{SPEAKER}'][events_if2 tag='#ESC_ATT{TOPIC}' is_empty=1]
    [/events_if2][/events_if]

    (also, be carefull: wordpress sometimes doesn’t like “[” and “]” right next to each other and might ignore it …)

    #47605
    Anonymous
    Inactive

    Do I need to re-install the plugin to get this new functionality?

    Also, if I find wordpress is ignoring my back to back brackets, is there a workaround?

    Also also, many thanks for the speedy response!

    #47606
    Franky
    Keymaster

    Either install the trunk version or wait for the next released version.

    Trunk: http://downloads.wordpress.org/plugin/events-manager-extended.zip

    If wp ignores the back to back brackets, just put a space in between them.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top