Skip to main content

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



  • 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}

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




  • Emma Muirhead

    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 



Please sign in to leave a comment.