Skip Navigation

[Resolved] adding a marker to a map

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 50 replies, has 3 voices.

Last updated by martinP-13 3 years, 9 months ago.

Assisted by: Jamal.

Author
Posts
#1706441

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Toolset won't be able to pull location data or marker data from template files such as "single-organizer.php" or "single-venue.php". The data needs to be pulled from a Toolset view or content template.

As you can see in the example that I have shared in my previous reply, we put ONE map in the Toolset content template with the wpv-map-render shortcode, and we pull location data from, both, the content template and the view with the wpv-map-marker shortcode.
We also make sure to use the same map_id in both shortcodes to let Toolset apply its logic and put the markers in the map.

Currently, Toolset does not support this use case if you click on any of those events it will show the map for that event
It only supports to display the marker content when the marker is clicked. Marker content is anything inside the wpv-map-marker shortcode.

#1706545

this is so frustrating Jamal i feel after 2 weeks i haven't progressed in the slightest. i am going to try to explain this as best i can as i feel its gotten lost along the line.

i have a post type called organisers ( re labelled to clubs). on this page there is no post relationship from toolset , the events calendar all ready does this.

the organiser page shows the the events related to that club (no relationship by toolset )

the events related to the organiser include all the venue details for that event .

so on this page i have all the info i require.

the current map on there shows the location of the organiser(club) this map will no longer be shown (but is still needed)

so now i must create a view and a map and some how drag in the address fields from the already present data on that page .

one would not expect the level of difficulty it is proving to be.

the view im creating is here hidden link
you will see its no map yet im just trying to get the locations needed to view

on the front end it is here hidden link

. can you offer any assistance jamal?
thanks in advance
martin

#1706809

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Martin, I am really sorry you felt frustrated by the handling of this ticket. I want to assure you that we'll always do our best to help with any issue related to Toolset. We'll answer your questions, and we'll escalate to our developers any found issues with our plugins.

Please keep in mind, that Toolset only affects the return of the WordPress function the_content(), this function is usually used by theme/plugins' authors to render the content of a post/page/cpt. Check this screenshot hidden link

I also could not found the template files that you have talked about, such as the files are located here : single-venue/organizer.php in public_html/wp-content/themes/simply-responsive-cp/tribe-events/pro
Please share a direct URL such as hidden link

I checked the following Toolset elements:
- Content template "map for single club post" here hidden link
- View "show venue on club map" here hidden link

I added on both the following HTML markup to check if they are being used on the frontend:

<div class="jamal" style="display: none;"></div>

But they are not. I could not find this markup generated on hidden link

I would like to use the "What template" plugin, but the WordPress admin topbar is not generated, even if my user profile is set to use it hidden link

I remember that the map was generated before, on one of the shared pages. But for now, I can't see a map for the given example hidden link
And the view does not seem to be used anywhere hidden link

I am sure, you will understand, that we, as supporters, work on different clients' tickets and we can't remember the context every time. We also find it difficult to work on websites with different themes and plugins. That's why we prefer to have a minimal setup(only the required plugins to demonstrate the issue).
But that does not mean we won't help. We'll do our best. But we'll need your collaboration and as many details as possible.

Please, put the map on the content template, and once it is ready, I'll check it and I'll make sure the view renders the markers on the map from the pulled data.

I'll reply to you as soon as you prepare this.

#1706991

i appreciate every bit of support jamal so thankyou!
can you set me a private reply so i can share some stuff? thanks again

#1707019

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Of course Martin! Your next reply will be private.

#1707543

for the files mentioned please goto [cPanel credentials moved to a private reply]

But they are not. I could not find this markup generated on hidden link
i removed the map on organisers pages as i no longer need to show the clubs location

in single-organiser.php you will find on line 74 <?php echo do_shortcode('[wpv-view name="show-venue-on-club-map"]');?>
this view is here hidden link

to use the toolset template for clubs in single organiser on line you must add < ?php the_content(); ?> on line 73 of single-organiser.php. (which i dont want to use )

#1707571

THE file that puts the venues into the list at the pevious events is here
hidden link

line 51 to 68

thanks

#1707751

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for these details, but I am sorry, I do not understand what the last file(single-event.php) does.

Here what I have done so far to get to a map that displays markers from the "show venue on club map" view and from the current club. And here what I got hidden link

I put a map and markers on the view "show venue on club map".

Then, I created a content template that will pull the location data from the current club. Its name is "Content template to pull club location data" you can edit it here hidden link
This content template only includes a marker that has the same map_id as the view.

Then I added the following line to the file single-organizer.php to render the content template, at line 74:

<?php echo do_shortcode('[wpv-post-body view_template="content-template-to-pull-club-location-data"]');?>

The marker on the content template has a differnt icon, I'll let you update it as it suits you.

I hope that this is what you are looking for. Otherwise, please explain what have I missed.

#1707999

WOW you have all but nailed it , the ONLY problem is the map is showing events for all clubs and not just the club who's page we are on . using the example page here hidden link

if at the bottom you expand the VIEW PREVIOUS TRIAL RESULTS , then you will see there are 6 events listed using 5 different venues.

obviously the link is there allready for the events and clubs from the events calendar.

thanks jamal its all most perfect. many many thanks

#1708561

hi jamal i have had a proper look at this , it basically shows all the clubs locations ? , it needs to show the venues location related to the clubs?

what you have achied is a duplicate of this page here that i did a few weeks ago .hidden link (except you have a home marker for the clubs own page ) ??

try to clarify a little more ...

hidden link

this is an ORGANISER post from the events calendar .

at the bottom of the page you have VIEW PREVIOUS TRIAL RESULTS these are VENUE post from the events calendar that are related to this club .( the evnts calendar check the $organiserid for the current post to load and achieve this )

to summarise rather than dispaly all the CLUBS (organisers) , it need to display the VENUES relevant to the organiser id for the page it is on .

thanks jamal

#1708585

ok so i delved a bit more into this with the events calendar plugin , in the single-organiser.php , it uses
$organizer_id = get_the_ID();

to diplay the venues (trial loations) it uses (line583):

<?php echo tribe_include_view_list( array(
'organizer' => $organizer_id,
'eventDisplay' => 'past'
) );
?></p>

so now it calls the template for the single-event using the list view of the events calendar. which is single-event.php located here
hidden link

the venue is displayed line 51 to 68

the single.event.php is responnible for EACH evnent that displays the venue at the the bottom of hidden link under view previous trial . (for this one club).

i need toolset to recognise the $organiser_id of the page its on , then grab the venue detials from the single-event.php .
the map then displays ALL the venues associated to the organiser_id for the page we are on,,

very hard for you to get head around i recognise that and appreciate the effort you are giving to me jamal.

thanks martin

#1708599

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for your feedback.
Indeed the map is displaying clubs because the involved view is querying clubs. Check this screenshot hidden link

If I understand well, you want to display the 6 events on the map right?

When I check the single-organiser.php file, it seems that the "VIEW PREVIOUS TRIAL RESULTS" is generated by a function from the plugin(tribe_include_view_list). Check this screenshot hidden link

Toolset Maps will not be able to put markers generated by another thing than a Toolset element(view, content template, archive template). We'll need to create a view that will query these events, and use it inside the content template, or inside the single-organizer.php file. And we'll need to put markers on that view with the same map_id.
I would love to prepare such a view, unfortunately, I still don't understand very well the plugin's data model and how events and venues are related.
Maybe there is a function by the plugin that can return these events/venues IDs, we can use that function and pass the IDs to our "new" view.

So, I'll need your help here. Can you explain how the events/venues are related? Or better, can you prepare a view that will return the same data and put it there, I'll take on from there.

#1708677

ok so the events calender has 3 post types
events
venues (mine re re labelled-as trial locations)
organisers ( (mine re re labelled-as clubs)

on each event it displays the organiser and venue
on each organiser and venues it diplays past and future events

for EACH event it uses single-event.php
for EACH organiser it uses single-organiser.php
for each venue it uses single-venue.php

each template checks the ID of the events ,organiser or venue .

the organiser page (the example above in our case is barton on humber) checks the id of the current post and then calls the template the single event.php to display the past and previous events related to the organiser ID.

so i thuink i need a function adding for toolset to check the id if on an organiser page . and like you say a view to display the venues related to that organisers id.

in this thread you have the login details for cpanel located here
hidden link

path filer are

single-event.php= wp-content/themes/simply-responsive-cp/tribe-events/list/single-event.php

organiser= wp-content/themes/simply-responsive-cp/tribe-events/pro/single-organizer.php

venue= wp-content/themes/simply-responsive-cp/tribe-events/pro/single-venue.php

the event calendar has this page for aall its functions and hooks etc etc

hidden link

thanks jamal

#1708831

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for the explanation. But I can't debug the theme or how the plugin works, that's out of the scope of the support forum. Please check our support policy https://toolset.com/toolset-support-policy/

I'll suggest reaching out to the plugin authors and asking how to get the list of IDS of the venues or the events separated by (,) from the current organizer. We can use that on a view with a shortcode. For example:

[wpv-view name="our view name or slug" ids="[shortcode_that_returns_posts_ids]"]

Check this article https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/

Otherwise, I'll suggest asking on general support forum, such as StackOverflow, or hiring a developer for help. Check our partners here https://toolset.com/contractors/

Thank you for your understanding.

#1708951

i fully understand , this will work to get all the venues [list_venues] , i just then need to compare the organiser id ? is it possible you can set the view to work with this shortcode ? then i can et about getting just the venue id required with the events calendar? thanks jamal appreciate your help
martin

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.