Home › Forums › Calendar Products › Events Calendar PRO › Map View – No Location
- This topic has 6 replies, 3 voices, and was last updated 5 years, 11 months ago by amycarolyn.
-
AuthorPosts
-
April 16, 2018 at 7:30 am #1508158amycarolynParticipant
I understand that Map View, by design, only shows events with an address. My client wants to use the Map View for the main view but wants all events to show even if there is no address. Is there a function/filter I can use to modify the Map View to do this?
April 17, 2018 at 1:19 pm #1509631AndrasKeymasterHi amycarolyn,
Thanks for getting in touch with us!
This essentially looks like a custom development task and so is outside of our stated scope of support.
With that being said, we’d love to help point you in the right direction.
It looks like that the query that runs on the map view would need to be adjusted.
We do need to prioritize support requests from other customers at this time but I’ll certainly flag this with the team and – although we can’t make any promises – if we have time and space to come back and help, we’ll be happy to do so. Please let us know if you’d like to go this route so that you can be added to this queue.
In the meantime, if there is any more information you can share (including mocks) that will help us to better understand what you are seeking please do feel free to add them to this ticket.
If you urgently need help with this, however, you may instead wish to consider working with a suitably skilled developer or designer who can offer the additional level of support you require.
Thanks and cheers,
AndrasApril 22, 2018 at 6:44 pm #1513324amycarolynParticipantI am a developer I was just hoping you had the correction function on hand or could point me to the right part of the documentation as I’m having trouble finding information on it.
April 22, 2018 at 7:03 pm #1513326amycarolynParticipantI found a solution in a different support ticket where the Event view is modified with a function. It looks like that person received help for a similar question so can you confirm you can’t help me? I do have a Pro license (and we’ve purchased a Community license as well under my client’s account).
//*Show All Events in Map View
add_action( ‘tribe_events_pre_get_posts’, ‘unlimit_map_view’ );
function unlimit_map_view( $query ) {
if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX && $query->get(‘eventDisplay’) == ‘map’ ) {
$query->set(‘posts_per_page’, ‘-1’);
}
return $query;
}I’m thinking I can use this to pull events that don’t have a location attached but since I don’t know how it’s being queried to begin with I’m not sure how to override it. Do you know which file contains the query? I haven’t found it yet.
April 23, 2018 at 7:49 am #1513773BarryMemberHi Amy!
We always try to help where we can, even for custom dev requests such as this one – you’ll certainly see lots of examples of us doing so throughout the forums – but technically questions like this lie outside our stated scope of support. What we’ve started to do in these situations is add requests like yours to a queue of similar questions and if time and space opens up for us to review and help, we will follow up as I am doing now. I hope that clarifies our policy about these things 🙂
As I understand your question, you still wish map view to contain a map, but you want the list of events below the map to include all events including those which are not assigned to venues or which are assigned to venues but where the venues themselves do not have any geodata that would allow us to position a pin on the map. That being the case, the following snippet may be helpful:
https://gist.github.com/barryhughes/ab991dcf98bfe13125266c9b25fcafa7
This could be added either to a custom plugin (preferred) or else your theme’s functions.php file may work, though we don’t generally recommend this.
Does that meet your needs here?
April 23, 2018 at 7:56 am #1513795amycarolynParticipantYes, this is perfect and works great. Thank you! Have a nice day.
April 23, 2018 at 11:55 pm #1514382BarryMemberAwesome, happy to help 🙂
May 15, 2018 at 9:35 am #1530993Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Map View – No Location’ is closed to new replies.