Communities is becoming a necessity to manage customers and partners and why not, it's easy that way isn't it? We (at Briskminds) are currently handling around 10 active projects where we need to implement the communities, but of-course we were also new to it few months back.
We've followed some simple steps to enable and use it, and would like to share that with my fellow community members as well. Let's explore more how we can enable and customize our community.
How to enable communities
- Go to Setup > App Setup > Customize > Communities > Settings
- Enable the checkbox "Enable communities"
Register For Domain
Once enabled the communities it will ask for the domain name, show in picture. Once registered for the domain you can now create your community, by clicking on “New Community” (Customize | Communities | Manage Communities, then click New Community) button.
Allowing profile to login in community
- Once you create new community then click on edit.
- It will show the screen as displayed in picture (please remember this, as we will refer the same Edit again and again)
- Click on “Members” tab
- Once clicked on “Members” tab, it will show the screen as displayed in picture
- Here you can enable profiles and give permissions to users
- If you are creating a community user then make sure profile assigned to that user is listed here (in “Selected Profile”) else user will not be able to do anything with the email which will be received after new user creation.
Allowing Tabs and Pages
- Click on “Edit” against your community
- Now click on “Tabs and Pages”, it will show the screen displayed in picture
- Select “Use Salesforce.com tabs” (let’s not dive into using site.com as it is a separate topic)
- Then you can select the tabs which you want to show to the community users
- Note – First tab selected will be the landing tab
Custom Branding
- Click on “Edit” against your community
- Now click on “Branding”, it will show the screen displayed in picture
- From here you can customize your headers and footers (formats are mentioned in picture) (which will be displayed on the native screens, and depends if you’ve applied on custom pages/tabs) and color theme to the community
Customize Login Page
- Click on “Edit” against your community
- Now click on “Login Page”, it will show the screen displayed in picture
- Now you can give your company logo in login page. Whenever user open your community link, then you can show your company logo in header and show your content in footer.
- If you need to completely change the login page to your visualforce page then we need to follow some more steps mentioned below :
(i) Create an apex class and visualforce page you want to show as your login page. Keep it simple for now.
Apex Class :
- global with sharing class CustomLoginController
- {
- global String username {get; set;}
- global String password {get; set;}
- global CustomLoginController () {}
- global PageReference login()
- {
- return Site.login(username, password, null);
- }
- }
Visualforce Page (please change this according to your need) :
- <apex:page controller="CustomLoginController" doctype="html-5.0" showheader="false" sidebar="false" standardstylesheets="false">
- <apex:form>
- <div class="wrapper">
- <div class="inside">
- <h2>
- Login to Community</h2>
- <div class="form">
- <apex:pagemessages id="error">
- </apex:pagemessages>
- Username
- <apex:inputtext styleclass="userNameInput" value="{! username }">
- Password
- <apex:inputsecret styleclass="passwordInput" value="{! password }">
- <apex:commandlink action="{! login }" styleclass="signInButton" value="SIGN IN">
- </apex:commandlink></apex:inputsecret></apex:inputtext></div>
- <div class="links">
- <a href="https://cloudcatamaran-developer-edition.ap1.force.com/customercommunity/ForgotPassword">Forgot your password?</a> | <a href="https://cloudcatamaran-developer-edition.ap1.force.com/customercommunity/CommunitiesSelfReg">Join our Community</a>
- </div>
- <div class="footer">
- Powered by <a href="http://cloudcatamaran.com/">Cloudcatamaran</a></div>
- </div>
- </div>
- <!-- .wrapper -->
- </apex:form>
- <style>
- body {
- background: url('../img/bg.jpg') no-repeat top fixed;
- font-family: Arial, sans-serif;
- background-size: 100%;
- }
- .wrapper {
- width: 400px;
- margin: 50px auto 0 auto;
- box-shadow: 0 0 10px black;
- border-radius: 5px;
- background: white;
- }
- .wrapper a:link,
- .wrapper a:hover,
- .wrapper a:visited {
- color: #157bc2;
- text-decoration: underline;
- }
- .wrapper.inside {
- padding: 10px;
- }
- .wrapper h2 {
- color: #157bc2;
- display: block;
- font-size: 20px;
- text-align: center;
- }
- .wrapper p {
- margin: 0;
- }
- .wrapper input {
- padding: 5px 10px;
- border: 1px solid grey;
- width: 360px;
- }
- .wrapper.signInButton:link,
- .wrapper.signInButton:hover,
- .wrapper.signInButton:visited {
- background: #157bc2;
- color: white;
- text-transform: uppercase;
- width: 100%;
- display: block;
- padding: 10px 0;
- text-align: center;
- text-decoration: none;
- border-radius: 3px;
- margin: 5px 0;
- }
- .wrapper.links {
- text-align: center;
- font-size: 14px;
- width: 100%;
- }
- .wrapper.footer {
- text-align: center;
- font-size: 12px;
- color: grey;
- width: 100%;
- margin-top: 20px;
- }
- .wrapper.messageCell {
- color: red;
- }
- .wrapper.messageCell h4 {
- display: none;
- }
- </style>
- </apex:page>
(ii) Now go toSetup>Customize>Communities>Manage Comunities and click on force.com link as shown below
(iii) Now scroll down and click on edit "Site Visualforce Pages"
(iv) Now add the custom page you just created to "Enabled Visualforce Pages"
(v) Once saved, click on Edit as shown below :
(vi) Now add “CustomLogin” page as shown below. And save it.
(vii) Now click on "URL Redirect" as shown below :
(viii) Now add partial source URL (Ex. /support/login ) in Source URL textbox and partial target URL in (Ex. /support/CustomLogin) in Target URL textbox and click save.
Create New User
- Create a new account (Go to your org as internal user and then click on account tab and then new)
- Create a new contact record under newly created account (Go to the newly create account and then click on new on contact related list)
- Open contact record and click on “Manage External User” button (as shown in picture) and then click on “Enable Customer User” link, it will redirect you to user record
4. When you click on Save button (on new user screen), please ensure that the current logged in user should have a role to create this new user otherwise it will give you error.
Publish It
Once you are done with everything and ready to use your community then you will click on publish as shown in picture
No comments:
Post a Comment