Skip to main content

Add a Contact Profile Picture

What You’ll Do

  • Replace the user icon with the contact photo

Step 1: Add the Contact Photo

Again, we will replace the createTile function between the /* FUNCTION createTile */ comments with the following code:

/* FUNCTION createTile */ function createTile (record) { return [ '<li class="slds-item">', '<div class="slds-tile slds-media">', '<div class="slds-media__figure">', '<img class="slds-avatar slds-avatar_medium" src="', record.get('PhotoUrl'), '" alt="" />', '</div>', '<div class="slds-media__body">', '<h3 class="slds-truncate" title="', record.get('Name'), '"><a href="javascript:void(0);">', record.get('Name') ,'</a></h3>', '<div class="slds-tile__detail slds-text-body_small">', '<p class="slds-truncate">', record.get('Title') ,'</p>', '</div>', '</div>', '</div>', '</li>' ].join(''); } /* FUNCTION createTile */

Step 2: Preview

Save your page, and click the Preview button.

Preview of Visualforce page after adding profile picture to each contact

계속해서 무료로 학습하세요!
계속 진행하려면 계정을 가입하세요.
얻을 수 있는 이점
  • 커리어 목표에 대한 개인화된 권장 사항 제공받기
  • 실습 과제 및 퀴즈를 통해 스킬 연습
  • 진행 상황을 추적하고 고용주에게 공유
  • 멘토십과 커리어 기회에 연결