%%[[if !publish]]%%

            <span>Data Only Displays on Published Page.</span>

 %%[[endif]]%%

%%[[if publish]]%%
        <div class = '%id=classname% '>

    <?php
        $theType = '%id=fieldtype%';

        if($theType === 'image'){

           echo '<img src = "' . $fetch['%id=fieldid%'] . '"' . 'onerror="this.style.display=\'none\'"' . '>';


         }elseif($theType === 'link'){
             echo '<a href=' . '"' . $fetch['%id=fieldid%'] . '">' . $fetch['%id=fieldid%'] . '</a>';
         }else {
             //echo $fetch['%id=fieldid%'];
             // if its start or end check if allDay = True and do not display the time 
                       $fieldId = '%id=fieldid%';
                        if ($fieldId == 'ev_start' || $fieldId == 'ev_end') {
                            if($fetch['allDay'] == 'True'){
                                echo '<td>'.substr($fetch[$fieldId], 0, 10).'</td>'; 
                            }else{
                                echo '<td>'.$fetch[$fieldId].'</td>';
                            }
                        } else {
                            echo $fetch[$fieldId]; 
                        }
         }
    ?>
        </div>
%%[[endif]]%%
                       