"Conditionally-hide" content if a token is NULL or empty
If there is no content in the title field then the popup displays blank.
I want to be able to remove the text 'Title:' as well as the blank space if the field token is null or empty.
We had the follow "conditionally-hide" being used in our map tips for our html5 viewer, but it does not seem to be working.
I believe this used to work.
Does any one know of any alternatives, or how to get this to work??
<div class="conditionally-hide" dir="Title{TOKEN}" style="font-weight: normal;">
<strong>Title:</strong> {TOKEN}
</div>
-
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 -
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.
Comments
2 comments