If statement for city

Home Forums Calendar Products Events Calendar PRO If statement for city

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1027125
    Robert
    Participant

    Hello,

    I’d like to add an if statement for city and state. I followed the directions as per this thread: https://theeventscalendar.com/support/forums/topic/why-doesnt-the-calendar-views-tooltips-show-the-event-location/ to add the city view. But I want to ensure that if there is no state specified for example it doesn’t show a comma and no state.

    How would I write an if statement since it doesn’t seem to work the traditional way?

    #1027178
    Brian
    Member

    Hi,

    Thanks for using our plugin. I can try to help out here.

    I am not sure a if statement will work in the tooltip as it is all javascript there.

    What about adding the comma to the state and so if there is none it would not show?

    If not I would look to add the if statement where these variables are and send it to the tooltip that way and not try to change it there.

    city = array();
    $getcity = tribe_get_city();
    $city['city'] = $getcity;
    $state = array();
    $getstate = tribe_get_state();
    $state['state'] = $getstate;

    Let me know if you have any follow up questions.

    Thanks

    #1027639
    Robert
    Participant

    Hi there.

    Where would the comma go then? Its in the plain text and there is no area to specify IF exists show coma with the state.

    Can you be a little more specific with the examples? thanks.

    r

    #1027647
    Brian
    Member

    I am not sure what coding you are using.

    Can you provide your custom coding I can try to help out, but I am not able to provide all the coding for a customzation.

    #1075685
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘If statement for city’ is closed to new replies.