Skip to main content

"Conditionally-hide" content if a token is NULL or empty

Comments

2 comments

  • Berend Veldkamp

    A trick that you can use is to add a styling rule to SITE\Viewers\VIEWER\VirtualDirectory\Resources\Styles\Custom\common.css

    .conditionally-hide {
      display: none;
    }

    Then modify the template to include {TOKEN} in the class name:

    <div class="conditionally-hide{TOKEN}" dir="Title{TOKEN}" style="font-weight: normal;">
    <strong>Title:</strong> {TOKEN}
    </div>

    If token is empty, the rule will apply and the entire div will be hidden.

     

     

     

    2
  • Emma Hollinger

    Thank you very much Berend Veldkamp

    That solved my issue. I have taken over development of these sites and was missing the styling rule to get the formatting to actually work!!

     

    Thanks again :D 

     

    1

Please sign in to leave a comment.