WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Combining conditional placeholders (7 posts)

  1. snatrott
    Member
    Posted 2 years ago #

    I want to display the booking button for logged in users and a link to the event page for users that are not logged in. I put the following code into my Default event list format area:

    {has_bookings}
    {logged_in}
    #_BOOKINGBUTTON
    {/logged_in}
    {not_logged_in}
    <a href="#_EVENTURL" title="#_EVENTNAME" class="button">Register now</a>
    {/not_logged_in}
    {/has_bookings}

    The proper buttons display if I remove the has_bookings placeholders, but the Register Now button shows up on every event and not just the ones with bookings enabled.

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    will have a look and fix if so

  3. snatrott
    Member
    Posted 2 years ago #

    Any luck with this one?

  4. banton
    Member
    Posted 2 years ago #

    I have a similar problem with multiple conditions.

    {is_future}
    {has_image}Show the image as #_EVENTIMAGEURL{/has_image}
    {no_image}Show a default image{/no_image}
    {/is_future}

    The images work just fine without the {is_future} -condition.

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    actually, yes, there is a fix for this, you have to manually this record to your wp_options table:

    option_name = dbem_conditional_recursions
    option_value = 1 or more

    you could do this e.g. with the adminer plugin

    change the number to the number of levels, in bantons case, it'd be 2.

    this is because most people don't nest conditionals, and this requires extra processing for each level of nesting.

  6. banton
    Member
    Posted 2 years ago #

    Thanks, that solved my problem.

  7. blackriver
    Member
    Posted 1 year ago #

    Thanks for the solution. Maybe this should be a part of the General Options page, or at least, it has to be mentioned on the user guide page: http://wp-events-plugin.com/documentation/conditional-placeholders/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic