Salesforce Communities are an amazing way to share information with your customers and partners. In particular, the Community Builder is a powerful management environment in which you can customize and play with the look and feel of your community. Below are two easy tricks that can help make managing your site a little easier in the Community Builder.
Tip 1: Reference your Company Logo in Lightning Component code
Community Builder has a tab called “Branding”, where you control some site-wide attributes of your community like colors, fonts and the company logo. This powerful feature allows you to re-use your logo image throughout the site without having to upload another copy of the same file or maintain different versions.
There’s a trick if you’re using Napili’s standard theme – let’s say you are creating a custom navigation bar for your Community. You’ve already uploaded your Company Logo into the Branding tab, and you want to to re-use that image in your navigation Lightning Component. To do this, simply create an “a” tag with the class “cBrandingLogo” in it:
This will pull your logo file into position on the page. When you update your company logo in the Community Builder Branding tab, that logo will also be automatically updated whenever you’ve used an “a” tag with the “cBrandingLogo” class in your HTML code. Easy and efficient!
Tip 2: Good Labels for Easier Reference: Custom Lightning Component Labels
Your custom components are displayed at the bottom of the “Components” tab in the Community Builder. Sometimes, component names are not very user-friendly; other times, there might be multiple components with very similar names (ex: namespace_mytestcmpItem and namespace_mytestcmpList).
To make component names more human-friendly, you can change the display name of the Lightning component for this part of Community Builder.
1. In your org, go to the Developer Console. Open your Lightning component, and click on the DESIGN tab in thebundle:
2. Here in the design:component tag, add the “label” attribute with your human-friendly label text, and click save:
That’s it! If you refresh in the Community Builder you will see your component has the new label:
SO much easier to find and manage!
We hope you find these tips useful, and we’ll provide more in future posts. What are your handy tips for working in Communities?