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.