Plugin Author
Baden
(@baden03)
Hmmm. It might be best if you could share a link, but we’ll try and follow along.
So you are trying to print a page that has a map and markers.
the map is printing, however the markers are not.
To print the markers you will need to do what exactly? Inject some JS into the head tag of the print page?
We have just added the ability to inject scripts, load fonts and js files to Print-Pro-Matic, but it’s not exactly clear if this would resolve your issue.
What needs to be added to your print page to display the markers, exactly?
Thank you for the prompt reply.
This is the demo site for The Events Calendar (which I’ll shorten to TEC), a single event page as is the one I am trying to print properly: http://wpshindig.com/event/womens-javascript-study-group/2016-09-07/
The injection (insert HTML options in the settings page) is what I was referring to as a test. The test didn’t work (I presume because the top HTML doesn’t get put into the <head>) but I only did it to try and isolate which script(s) needed to be included. Doing an injection I don’t think is the answer, because the marker is different on most single event pages, and is automatically generated. If we were to inject something, it would first have to hook into TEC to generate the right data. That’s why I suggested excluding rather than including – so instead of trimming the header/footer JS, we could just pass along any that matched a certain regex.
As I was unable to verify with the test which script exactly was responsible for the marker, my best guess is one/some of the following, which are taken from the sample page I linked to.
In the header:
<script type='text/javascript' src='http://wpshindig.com/content/plugins/events/src/resources/js/tribe-events.min.js?ver=4.2.2'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var TribeEventsPro = {"geocenter":{"max_lat":52.371969,"max_lng":151.188382,"min_lat":-33.891467,"min_lng":-122.65644},"map_tooltip_event":"Event: ","map_tooltip_address":"Address: "};
/* ]]> */
</script>
<script type='text/javascript' src='http://wpshindig.com/content/plugins/events-calendar-pro/src/resources/js/tribe-events-pro.min.js?ver=4.2.1'></script>
Footer:
<script type='text/javascript' src='https://maps.google.com/maps/api/js?ver=4.5.2'></script>
<script type='text/javascript'>
/* <![CDATA[ */
var tribeEventsSingleMap = {"addresses":[{"address":"989 Market St San Francisco CA United States ","title":"Zoosk"}],"zoom":"15"};
var tribeEventsSingleMap = {"addresses":[{"address":"989 Market St San Francisco CA United States ","title":"Zoosk","coords":["37.7823418","-122.4095812"]}],"zoom":"15"};
/* ]]> */
</script>
<script type='text/javascript' src='http://wpshindig.com/content/plugins/events/src/resources/js/embedded-map.min.js?ver=4.5.2'></script>
-
This reply was modified 9 years, 8 months ago by
specksy.
Plugin Author
Baden
(@baden03)
ok. I see two possibilities both would require using Print-Pro-Matic. If you do decide to upgrade, we’ll help you set this up as part of our pretty-amazing plugin support.
The two ways this could work:
1. use the new head-inject feature to inject what you need into the head element of the print-only page. This might work, but I think an even smarter option would be:
2. create a custom print-only template that get’s called with the print trigger. This would allow you to include only what you need for the print page exactly as it does on the display page.