You need to sign in to do that
Don't have an account?
Conditionally Render Image on Visualforce Page Based on Field Value
Hello Community- seasoned Admin, but beginner developer here!
I'm building a Visualforce page that will serve as the default landing page for my Salesforce Community, and as a personal touch would like to display a nice welcome message and content that would render dynamically, based on who is logging in. As far as merge fields go, I'm all set.
However where I'm getting stuck is to conditionally display a set of images stored in Documents, based on the Current User's value in the Company field({!$User.CompanyName}).
I've attempted to write logic using IF/ELSE IF/ELSE commands, however it's just not rendering correctly. In short, here's what I'm trying to achieve:
If User's Company Name = 'Company 1', display Logo 1
If User's Company Name = 'Company 2', display Logo 2
..and so on..
...and so on...
....Else, display nothing
Thanks in advance for any suggestions you can provide!
I'm building a Visualforce page that will serve as the default landing page for my Salesforce Community, and as a personal touch would like to display a nice welcome message and content that would render dynamically, based on who is logging in. As far as merge fields go, I'm all set.
However where I'm getting stuck is to conditionally display a set of images stored in Documents, based on the Current User's value in the Company field({!$User.CompanyName}).
I've attempted to write logic using IF/ELSE IF/ELSE commands, however it's just not rendering correctly. In short, here's what I'm trying to achieve:
If User's Company Name = 'Company 1', display Logo 1
If User's Company Name = 'Company 2', display Logo 2
..and so on..
...and so on...
....Else, display nothing
Thanks in advance for any suggestions you can provide!
kindly look at the sample code. user rendered attribute like blow
Hope this will help you, Mark Best ANSWER if its work for you.
Thanks
karthik
<apex:form >
<apex:image id="theImage"
"value="{!IF(Company==A,$Resource.SRC_Image_Name_For_A, IF(Company==B,$Resource.SRC_Image_Name_For_B,$Resource.SRC_CommonImage_Name_For_All))}"
width="200"
height="200"/>
</apex:form>
</apex:page>
use if/else and also put a common image for whom any image not available.
kroger-feedback (http://kroger-feedback.us/)