Jump to content

How to determine custom field is null to hide field in infowindow


Gregory Bernardo

Recommended Posts

I want to show/hide a div if a custom field is null.

I have tried several different approaches and have come to determine that a passed custom field with null value is not actually null when processed by geoMaps.

 

Test code from 'map_infowindow.thtml'

<?php
  $liscense ='<span class="jr-map-jr_statelicensenum"></span>';
  $liscensestate ='<span class="jr-map-jr_statelicensed"></span>';
  if($liscense != ""):
      echo '<div>';
      echo 'License: '.$liscensestate.'-'.$liscense;
      echo '</div>';
  endif;
?>

 

Result if custom fields have value: 'License: TX-123456'

Result if custom fields are null:      'License: -'

 

What value can I use in  'if($liscense != ""):' to determine null/not null?

Thanks.

Greg

Link to comment
×
×
  • Create New...