Hi,
(Sorry this is in General Discussion, I’ve yet to get my account cleared for technical support.)
EE 2.2.1
I am using data from a channel to show pins and their info windows on a Google map. So in the head section of the page I have a script block to create everything. Part of which puts data into the info window like this…
{exp:channel:entries channel="my-channel"}
var text = "<div id='map_popup'><h3>{title}</h3><p>"<br />
{if address_line_1}+"{address_line_1}"{/if}<br />
{if address_line_2}+"{address_line_2}"{/if}<br />
{if town_city}+"{town_city}"{/if}<br />
{if county}+"{county}"{/if}<br />
{if post_code}+"{post_code}"{/if}<br />
{if phone}+"Telephone: {phone}"{/if}<br />
{if website}+"Web: <a href="http://{website}" title='Find Us on the Web'>{website}</a>"{/if}<br />
+"</div>";<br />
<br />
var latlng = new google.maps.LatLng({lat}, {long});<br />
createPin(latlng,text);<br />
{/exp:channel:entries}All seemed to be working great until I tested it with incomplete data and noticed it’s outputting the empty lines anyway. I’ve even tried changing one of the conditionals to {if 1==2} and that line was also output anyway.
Does anyone have any thoughts on why this might be happening or something I have missed?
Thanks