We want to be able to show different custom post type fields in the map pin popups depending on those custom fields. For example if a field is empty, I wouldn’t want to output anything. But on the other hand, if a field = “somestring” I may want to output additional data into the bubble.

The problem is that with the map settings I can only have one template that applies to every single pin bubble. What I need to do is change the template a little depending on custom field information.

I can change the data using Javascript but there doesn’t seem to be any way to attach code to the bubbles, or detect when a user clicks a bubble so I can change the text in it.

Is there any way for me to adjust the content of the pin bubble popup when a user clicks on a pin?

Here is a simple example. In my popup (infowindow) template I have this:

Send Message

It might be the case that the email field is empty, in which case I don’t want the entire block or button to show at all. How can I do this? I need to be able to “know” the field is empty and change the template output accordingly.


We're working on this problem in our new version meanwhile if you can give us login at support@flippercode.com, we can fix it at your end so empty tags will be removed automatically.
It's not just the tag I want removed, it's the markup around it. For example I'll put DIV tags or other markup on either side of the placeholder tag. If the tag is empty, I would not want to display the DIV tags or other markup too.
What I'm trying to do is perform a little bit of log, kind of like "if this tag has Y data, output this, but if it has that, output something else." I'm trying to change the template with some basic logic.

I also need some scripting abilities so that I can change how the content appears, such as limiting character length or adding buttons or links based on content.

So again, my main concern is that I need to add some JS/logic to the pin popups somehow.

Please login or Register to Submit Answer