You need to sign in to do that
Don't have an account?
hide images with condition
Hi,
I have a VF page that render as Pdf.
I need to show an image if a custom field has a custom value
This code works properly since some days ago but now doesn't work and I didn't any change to code!
<img id="id_image" src="{!if(opportunity.field__c = "a",'/servlet/servlet.FileDownload?file=01520000001OEBG','')}" height ="{!if(opportunity.field__c = "a",'948','0')}" width = "{!if(opportunity.field__c = "a",'700','0')}" />
I get this error:
The image at '' has a dimension set to 0. This can happen when the image is cached and later used with a different CSS style. Add a '?style=YourCssStyle' query parameter to the image URL to prevent caching.
I try to substitute 0 with null but I have a small image in the top corner left
How can I change the code or Do you know anoter way for my problem ?
thanks
If Field__c is "a", then the image is rendered, otherwise it won't be. You don't need to set the other attributes conditionally.
All Answers
If Field__c is "a", then the image is rendered, otherwise it won't be. You don't need to set the other attributes conditionally.
thanks, it works properly!!