simple text venue

This topic contains 7 replies, has 2 voices, and was last updated by  dcb 11 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #3632

    It would be nice if a venue could be a simple string, not necessarily complete geographic information.

    John Foerch
    #3643

    The geographical information is optional. In future versions the default templates won’t display a map if the venue lacks geographical information – but in general, you can edit the templates to remove this.

    Stephen Harris
    #3646

    Thanks. I was initially confused because I created an event, and wrote some text in the “venue” blank, and it did not get saved. Then when I created a venue, it displayed a map no matter what. Thank you.

    John Foerch
    #5466

    I am confused about this. When I create a venue and add no address information, it is still showing a map. I have some venues where we want the map to show and others where we want no map, just the text name of the venue listed.

    It seems that a default latitude and longitude are entered in the database even if you have not entered any location information. I guess we could code something in the templates that would check if all the address fields are blank (you never know which ones a user fills in) and then don’t display the map. Is there a better workaround?

    It would be nice if this was the default behavior of the plug-in or if there was a checkbox per venue – don’t display map.

    dcb
    #5474

    Hi dcb,

    Yes, by default the co-ordinates (0,0) are entered as venue meta. If you want to not display the map you can do so by editing the templates something like the following should work:

     if( !empty( eo_get_venue_lat( $venue_id ) ) || !empty( eo_get_venue_lng( $venue_id ) ){
            echo eo_get_venue_map( $venue_id );
      }
    
    Stephen Harris
    #5498

    Hi Stephen,
    This is not working for me, because when I enter a new venue and fill in the title field only it doesn’t appear to add 0,0 as the default location coordinates. When I save the venue without any location data then output the values for lat and long I get this:
    Lat,long 40.714353,-74.005973
    This shows up as New York City (which is not my location, but is my time zone). The New York City map also shows up on the venue edit page

    dcb
    #5501

    Ah yes, the map automatically finds a location based on the timezone if it can. I’ve not tested it, but does the following work?

      $venue_address = array_filter( eo_get_venue_address( $venue_id ) );
      if( !empty( $venue_address ) ){
         //Display map
       }
    

    It should only display a map if at least one of the address fields is not empty.

    Stephen Harris
    #5502

    No, something in the array must have a value? The map still displays. However, if I do this it works:

    $venue_address = array_filter( eo_get_venue_address( $venue_id ) );
    if( !empty($venue_address['address']) || !empty($venue_address['city']) ||!empty( $venue_address['state']) || !empty( $venue_address['postcode']) || !empty( $venue_address['country'])){
    //Display map
    }

    dcb
Viewing 8 posts - 1 through 8 (of 8 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.