Home › Forums › Calendar Products › Events Calendar PRO › Which php file controls .gm-style-iw class
- This topic has 8 replies, 2 voices, and was last updated 11 years, 9 months ago by
Barry.
-
AuthorPosts
-
July 11, 2014 at 11:15 am #349593
Erin Slater
ParticipantCurrently 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?July 12, 2014 at 8:48 am #361234Barry
MemberHi – 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:
I hope that helps!
July 14, 2014 at 2:37 pm #381958Erin Slater
ParticipantIs 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);
July 15, 2014 at 1:45 am #391194Barry
MemberIs 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!
July 15, 2014 at 9:41 am #395609Erin Slater
ParticipantThanks 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
July 15, 2014 at 3:45 pm #398529Erin Slater
ParticipantOk, 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.
July 16, 2014 at 12:01 am #405941Barry
MemberHi: 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!
July 16, 2014 at 8:38 am #412376Erin Slater
ParticipantThanks 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.July 17, 2014 at 2:24 am #425539Barry
MemberOK – 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!
-
AuthorPosts
- The topic ‘Which php file controls .gm-style-iw class’ is closed to new replies.
