Jump to content
  • 0

Hide Html Block When Field Is Blank


DMart
 Share

Question

Hi-

 

I've searched boards and knowledge base and can't seem to find an answer for this one:

 

In the Details page of my Report I have social media icons that connect to each person's FB, Twitter, etc pages. I did this by putting the icon image in an html block and then linking that icon to the appropriate field. Works like a charm!

 

Only problem is that there isn't an easy checkbox, like a regular image would have, that allows you to hide the image when the field is blank, so....I guess I need to know:

 

How do I hide an html block when the field inside it is blank?

 

Or, do I need to set this up differently in order to be able to hide the social media icon when the field is blank?

 

Thanks in advance for your suggestions!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 1

You can hide the HTML blocks by including the fields referenced in the HTML blocks as also hidden fields on the details page. Once the hidden fields are added, add a seperate section before each of the HTML blocks. Once Sections are in place, you can setup rules with Criteria field Is blank, then Hide Section X. This should achieve what you are requesting.

Link to comment
Share on other sites

  • 0

Hello DMart,

 

Welcome to Caspio Forum! :)

 

If I understand correctly, every person can have several (or all) social accounts. Is it correct?

If every person can have only one social account, I think it is better to display the correspond icon in one HTML Block.

Link to comment
Share on other sites

  • 0

Thanks for the warm welcome! (and the answer to my other question)

 

Yes, every person can have up to three social media accounts at the moment (one FB, two Twitter). I currently have each icon in a separate html block of their own and the icon is linked to its appropriate field (which is a link to their corresponding social media page). Does that help to clarify?

 

Some people will have only one or two of these sm accounts, so when that's the case I want the empty field to disappear, as well as its corresponding icon. 

Link to comment
Share on other sites

  • 0

OK, thanks, I'll play around with that. I was trying to figure out how to incorporate sections in there (for rule use) earlier, so this might help connect the dots for me.

 

Hopefully, the sections won't mess with the styling. Will give it a try.

 

Thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...