HTML help to not show object if blank

Started by RogerC, June 07, 2021, 12:04:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RogerC

I'm new to HTML and I'm struggling to find a way to not display an object if the object is empty. I have the following code:

<h4>{{id}} County Distilleries:</h4>
{{#each objects}}
   <h2>{{{distillery_name}}}</h2>
     <h4>{{address}} </h4>
   <h4><a href="{{website}}" target="_blank">Website</a></h4>
   <h4><a href="{{{my_visit}}}">My Visit</a></h4>
<h4><a href="{{{directions}}}" target="_blank">Directions</a></h4>   
{{/each}}

All objects are always filled except the my-visit one. If my_visit is blank then the text My Visit still appears. I don't want it to appear. Any suggestions would be greatly appreciate.

Roger C