Which php file controls .gm-style-iw class

Home Forums Calendar Products Events Calendar PRO Which php file controls .gm-style-iw class

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #349593
    Erin Slater
    Participant

    Currently when I click on an event in the map, I see a popup with two fields: Event and Address.
    I want to add the date as well to this box. Is there an easy setting to do this or if not which php file controls the info in this box?

    #361234
    Barry
    Member

    Hi – interesting question. The actual pin marker data can be modified by setting up a filter using the tribe_events_ajax_response hook.

    The marker data is basically an array of arrays – and each inner array represents a particular point on the map: it would be a bit of an advanced customization, but you could for instance alter the tooltip title in each to include the date – check out the threads linked to from this forum reply:

    Venue Links on Map

    I hope that helps!

    #381958
    Erin Slater
    Participant

    Is there not already a js function to get the start date? I think it would be easier if possible, to add that function to the tribe-events-ajax-maps.min.js file and then call it after the Address like: f=”Event: “+e;h&&(f=f+”<br/>Address: “+h+”<br/>Date: “+d);

    #391194
    Barry
    Member

    Is there not already a js function to get the start date?

    I don’t believe so, no – plus it probably wouldn’t be the best idea to modify core plugin code directly (though of course you could set up your own custom version of any of our own scripts and enqueue them in place of our own).

    Ultimately, I’m afraid, this remains a fairly advanced customization and all we can do in cases like this is give you a pointer in the right direction (in this case, that would be working with the tribe_events_ajax_response hook) or of course you are welcome to post a feature request if you would like to see more options in this regard in a future release.

    Thanks again!

    #395609
    Erin Slater
    Participant

    Thanks Barry, I submitted a feature request. Since this is a event calendar, I really think the date should be on the pin marker so maybe you can pass that along as well. Also, in regards to the ajax response hook, where is that code located? I can’t find it, nor do I see it in the documentation.

    Thanks

    #398529
    Erin Slater
    Participant

    Ok, I figured out where things were located and got it to populate the date using _EventStartDate. Issue now is the date as the time (which I do not want) and its formatted as Y-m-d, but I want it as m-d-Y since most customers are in US. Can you tell me where to change this setting? I tried changing the items in admin settings but it did not work.

    #405941
    Barry
    Member

    Hi: it depends on how you’re going about it. If you’re simply pulling the date/time straight in via WordPress’s post meta functions you’d definitely have some extra hoops to jump through – but you could alternatively use our tribe_get_start_date() function. Here are some examples of basic usage:

    // No params: it will assume the current event if
    // you're within "the loop" 
    echo tribe_get_start_date();
    
    // You can also pass an explicit post ID for the event
    // you're interested in
    $event_id = 123;
    echo tribe_get_start_date( $event_id );
    
    // By default it should include the time in its output
    // but you can tell it to exclude the time with an
    // optional 2nd param
    echo tribe_get_start_date( $event_id, false );
    
    // And you can pass in an explicit date format if you
    // need to do so
    echo tribe_get_start_date( $event_id, false, 'm-d-Y' );

    I hope that helps!

    #412376
    Erin Slater
    Participant

    Thanks for the info, $event_id sets the same date for all markers for some reason. What I did is add was to add the following to the generate_markers function in tribe-geoloc.class.php:
    tribe_get_start_date( $event, false, ‘l, F j, Y’ );. Now when I click on a marker it says for example: When: Friday, August 23, 2014. Not ideal, but it will do until this feature is added to the plugin.

    #425539
    Barry
    Member

    OK – so long as you’re happy that should work though I would like to add a note mostly for the benefit of other users coming across this thread that directly modifying core plugin code is generally not a great idea.

    Anyway – glad you’ve got a workaround in place and with that in mind I’ll go ahead and close this thread.

    Thanks!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Which php file controls .gm-style-iw class’ is closed to new replies.