Hide text or icon if there is no content in a minibase field

  • In the Staff Directory on my training site, I am using an image of the world that links to each person's website. For Jack Harkness, I did not enter a URL for his website field. The world image still displays, but it doesn't link to anywhere, so it just refreshes the page. This can be confusing for the end-user.
     
    If you are doing a Custom View MiniBase and you use an image or word as a hyperlink, there are two options to hide the image or word when a record's field has been left blank:
     

    Option 1

    Add "style="display: none into the record’s field you wish to hide.
     
    In this example, Martha Jones is missing the world icon because I entered "style="display: none for her record's website field. If I had left the website field blank or entered a URL, the world icon would have displayed.
    Option 1 example  
     
     

    Option 2

    Alter the Custom View's HTML in 2 steps:
    1. Add the following code at the bottom of the HTML window:
    <script type="text/javascript">
                                 $('.X').hide();
    </script>
    2. Adjust the <div> tag for each field that you want to hide to <div class="X$FIELD#>
    In this example, the word Website does not display for the records that have blank Website fields.
    The Left image is of the end-user view and the right image is of the HTML code.
     
    Option 2 example Option 2 example
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    - Holly Vaughn