How to pass Map Id along with post id to a listing page

Hoping to ping @VeBailovity on this. We're trying to have a map object open in a lightbox on a listing page. We're using a custom post type for a detail page for hotel, then pulling an excerpt, thumb (and theoretically map) onto a listing page. On that listing page I want to have 'view on map', and have that open in a lightbox without leaving that page. I'm thinking since post Id is present, and i've checked 'associated with this post' in the map, that the map id should also be present. Wondering how/where they're connected, and if there's some global function i can call. Would you be willing to help me out on this? We are really tricking out your awesome plugin and would be happy for you to showcase it anyway you like :slight_smile: Thanks!

  • 3SixtyEvolve
    • New Recruit

    Hi @jjsararas

    Thank you for your post and for being part of our Community.

    I will ping @VeBailovity to let him know that you need support with this. He is definitely the right person to speak to :slight_smile:

    Have a great weekend and have fun with your project.


  • Vladislav
    • Dead Eye Dev


    If the map is auto-created (from one of your custom fields), then it can be displayed automatically, together with the post. However, since you want it in a separate lightbox popup, it's probably better to insert it manually, using a shortcode and wrapped in some markup (say, a hidden DIV). The idea behind this would be to leave the plugin to render the map in the hidden div, then when an user clicks the "view on map" link, to open the hidden div in the lightbox popup. Of course, this would also require a few lines of javascript, to bind your lightbox to link click event.

    This is, of course, just an idea, and might work well if you only have one such occasion. For multiple occasions scenario, I think you might be better off letting the machine do the manual work for you. The idea here would be similar to the previous one, with one extra step - you can bind a content filter for your post type and in the processing function you can check if there are any associated maps with the post. If there are, you append the hidden div and the map markup (you can use the methods from the plugin marker replacer class) to content automatically. The end result should be pretty similar to the previous, manual idea.

  • 3SixtyEvolve
    • New Recruit

    Hope you're well @jjsararas.

    I'm just quickly checking in to see if there is anything else that we can assist with. Did you get sorted with the advice of Ve or are there still issues outstanding that needs to be addressed?

    Since we haven't heard back from you with an update, I will go ahead and resolve this topic, but please don't hesitate to reopen it should you still require additional support from us. Just select the 'Mark as Not Resolved (re-open)' box below the post area (otherwise we might miss your new post).

    Have a good day!


  • jjsararas
    • Site Builder, Child of Zeus

    @Gina! Your too fast! I can't get over how awesome the support in this community is. :slight_smile:
    I'm going to be looking into this tonight/tomorrow as other issues have piled up and kept me from all the fun. I'm going to give VeB's advice a go and will definitely post how it goes. I'll leave it resolved for now and open 'er back up if need be, sound good?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.