• Resolved specksy

    (@specksy)


    Hi,

    Firstly, I want to commend you on being so diligent and comprehensive in your support. It’s a rare, refreshing sight to see a plugin’s support forum filled with the creator’s username – on a free plugin nonetheless!

    Now that my nose is sufficiently brown, onto my issue. I am using your plugin to print single event pages on The Events Calendar. I’ve just realized however that although it does show the map, it does not show the map marker.

    I’ve tried copying the code from the full page in the pre/append HTML bits (though I’m aware the former wouldn’t output them in the header), and it doesn’t change anything.

    I think the most elegant way here would be to exclude pieces of the code from the trim, and the easiest would be to be able to match a regex.

    Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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?

    Thread Starter specksy

    (@specksy)

    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: https://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='https://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='https://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='https://wpshindig.com/content/plugins/events/src/resources/js/embedded-map.min.js?ver=4.5.2'></script>
    • This reply was modified 8 years, 2 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Print page JS exceptions’ is closed to new replies.