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.
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:
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 email@example.com, we can fix it at your end so empty tags will be removed automatically.
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.