Featured Opportunity and Search Results Blocks - Set default images

The CMS Featured Opportunity Blocks and the new Search (and Calendar) Result Block support displaying thumbnail-like images when shown on your public site.  Below is an example of the new calendar with images.

You can set images for individual volunteer opportunities.  This can, of course, requires some work, because if you activate displaying the images, you want to make sure that all your projects have images.  

One workaround is to set up a Process Builder in Salesforce that will add a default image to a volunteer opportunity when it is saved if an image is not assigned to it already.  

These are the steps to create the Process Builder.  If you are not familiar with the Process Builder, review the following Salesforce Trailhead:


You need to have a good understanding of Salesforce admin concepts and have access to the Setup in Salesforce.  

Let's start!

1) Go to the Process Builder (Setup > Create > Workflow & Approvals > Process Builder)

2) Click on the "New" button to create a new Process

3) Give it the name "HOC Default Thumbnail Image for a VO Back" and description "Assigns a default image to a VO if none is assigned"

4) Choose Object "Volunteer Opportunity" and Specify When to Start the Process "when a record is created or edited"

5) Define Criteria for the first Action Group.  The condition applies to the field [HOC__Volunteer_Opportunity__c].HOC__Image_Url_Thumbnail__c. It evaluates that the filed does not have a thumbnail image already.  

You also need to exclude Self-Reported volunteer opportunities by looking for the words "Self-Reported" or "Self-Reported Volunteer Hours" in the Volunteer Opportunity name: [HOC__Volunteer_Opportunity__c].Name.

6) Create an immediate action "Update Records" and name it "Apply Default Thumbnail".  See the image below.

Make sure the name of your image file does have an opening or closing parenthesis.   In some cases, images with parenthesis in their name are not displayed.  

In the Formula value, use a formula similar to one below.  You will most likely need to edit the script to:

  1. Match your impact areas to the ones you use.
  2. Upload your images to a place where you can reference them via a public URL. Salesforce does not have an elegant way to upload an image to an object since it does not have "File" field type.  Hence, you need to decide where you are going to upload all your thumbnails.  You can use Salesforce Files (or Documents but note that Salesforce will be retiring Documents) and make the URL public, or upload them to the HOC CMS.  Use JPEG or PNG images.
"Adult Education","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/adult-education-1.jpg",
"Arts & Culture","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/arts-%26-culture-2.jpg",
"Children & Youth Education","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/family-services-2.jpg",
"Civic & Community","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/civic-%26-community-2.jpg",
"Disaster & Emergency","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/disaster-%26-emergency-1.jpg",
"Family Services","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/family-services-1.jpg",
"Health & Wellness","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/health-&-wellness-1.jpg",
"Immigrant & Refugee Services","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/Immigrant-&-Refugee-Services-1.jpg",
"Senior Services","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/Senior-Services-1.jpg",
"Sports & Recreation","https://cdn0.handsonconnect.org/ps-shared-images/impact-area-thumbs/Sports-&-Recreation-2.jpg",
Click to copy

7) Activate and test your Process Builder!


Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.