Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have developed a VF page where I search Cases, Solutions and KnowledgeArticles and Display them .

To differentiate between Cases, Solutions and KA I want to Display respective sfdc standard icons.

I have tried using .

<img src="/s.gif" alt="Solutions" class="pageTitleIcon" title="Solutions"></img>

But this always .displays a icon of the VisulalForce Tab or the icon of the Standard Controller.

share|improve this question
up vote 6 down vote accepted

You need to use a relative path to the icons:

<img src="/img/icon/trophy32.png"/>

This will display a normal SFDC icon: enter image description here

Here you will get some overview of the standard icons.

In your case you can create two CSS classes for case and solution for example:

.caseIcon {
    background-image: url("/img/sprites/master.png");
    background-position: 0 -986px;
    height: 32px;
    width: 32px;

.solutionIcon {
    background-image: url("/img/icon/solutions32.png");
    background-position: 0 0;
    height: 32px;
    width: 32px;

And then dynamically assign these classes depending on the object type:

<img class="{!IF(object.type = 'case', 'caseIcon', 'solutionIcon')}" src="/s.gif">
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.