Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: HTML help to not show object if blank  (Read 84720 times)

0 Members and 1 Guest are viewing this topic.

RogerC

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows 10
    HTML help to not show object if blank
    « on: June 07, 2021, 12:04:05 PM »
    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[/url]</h4>
       <h4><a href="{{{my_visit}}}">My Visit[/url]</h4>
    <h4><a href="{{{directions}}}" target="_blank">Directions[/url]</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