Salesforce consultants per business requirements, often face the challenge to customize the login page in their new environments. While searching the internet where to start and the wast answers, it's unclear where to start and what specifically they need to do. In this post I will try to explain you exactly how you can use the unlimited potential of the Salesforce platform and make this possible.
For this example we will focus inside the platform and as a consultant you don't need to do anything outside of the Salesforce platform.
Create a Static Resource
First thing first, we need to create a Static Resource where we will place our image. Salesforce suggest we use 1050px width and 850px height when we wan't to create this image.
- Go to Setup
- Press Home
- Go to Static Resources
- Create New Resource
- Write a Name for the static resource. In our case we use landingImage.
- Write a Description (optional)
- Find your image file.
- Put Cache Control to Public
See images below.
Create a Visualfoce page
Now that you have created your static resource we need to place that in a Visualforce page that later we can use to place it in the section.
- Go to Setup
- Press Home
- Go to Visualforce Pages
- Create New visualforce page, for our example we will name it LoginPage
- Write your visualforce page custom code. Remember that landingImage is the StaticResource used in the code.
<apex:page showHeader="false" cache="false"> <apex:image url="{!URLFOR($Resource.landingImage)}" styleClass="img"/> </apex:page>
Create a custom Force.com site page
After the creation of the static resource and the visualforce page we need to create a force.com site page.
- Go to Setup
- Press Home
- Go to Site
- Create a new Site
- Add Site Label and Site Name
- Use your above created Visualforce page name in "Active Site Home Page".
- Make Sure, "Clickjack Protection Level" should be "Allow framing by any page (No protection)".
- Fill other details
- Activate the Site
Setup your Site to Right Frame URL
When we are done with the Site, we need to go back to Setup> Home > Site and scroll to the bottom of the page. On the new Site page copy your Site Url. This URL we will use it to do the final step.
- Go to Setup
- Press Home
- Go to My Domain and scroll down to the "Authentication Configuration". Click Edit.
- In the "Right Frame URL": paste the url that we copied from above, and make sure that "https" and the append "/" at the end of the URL.
Example: https://yourDomainName.secure.force.com/ - Press Save and go to your custom domain URL.
Result
The final result will look like this
I hope this post will make your Salesforce Consultant life more easier.
Want to learn more?
Learn about How to Bypass The Trigger with Apex
Read more about Customize Your My Domain Login Page with Your Brand
Share this article...
Leave a Reply