Solutions and Ideas to Customize Napili Template with Custom Lightning Components
Here we have reported custom solution for 7th, 8th, 9th, 10th and 11th limitations of Napili Template listed in the first article of the Communities on Steroids series.
7. Community User Personalization > Extended Navigation > Switch User Language and Region Preferences
A custom Lightning component, Navigational Header, was created (as shown in Figure 8) to give users the capability to switch community, region or language right from the header. Some key features of this custom component are:
- Can be configured by Community Administrator to include or exclude specific communities, countries and language filter options in the Navigation Header Component.
- Region and language settings of this component are respected and reflected in both standard components (like Rich Text Editor) and custom components (like Image Carousel, Trending Articles, Featured Articles,).
- User preferences for community, region and language selection are persisted across sessions.
- Configurability option for fallback language, if the default language is not available.
- Community filter provides an option to switch between partner and customer communities.
- Use of the custom Navigation Header component described above ensures that the anonymous user locale is defaulted to the settings in the browser locale and is not based on IP address. The custom component is designed to retrieve the browser locale and reload the community pages based on the appropriate locale.
8. Community User Community User Personalization > Personalized Content
Below is a list of custom Lightning components that are created to support the personalization requirements. They support personalization based on product, region and language preferences of the user. Wherever possible, personalization was supported by extending existing community components, like Rich Text Editor and Trending Articles components, rather than building components from scratch.
The use of these custom Lightning components eliminates the need to use Page Variations in the Napili Template, which are in turn dependent on User Profiles. Use of Page Variations is the default approach by OOTB Napili Template to support personalization. To support the Client’s requirements for personalization using Page Variations would’ve resulted in creation of hundreds of User Profiles, thereby impacting manageability.
- Custom Rich Text Editor component: Custom Rich Text Editor is a Lightning component built as a wrapper on top of standard Rich Text Editor. It is completely configurable by product, region and language. Configurations can be added or removed as needed. Figure 9 demonstrates the personalization capabilities of the extended Rich Text Editor for two different languages within the same component.
- Enhanced Trending Articles Component: A custom Trending Articles component is built by extending OOTB Trending Articles component with configuration capability to provide personalized content based on user product preference. Figure 10 showcases the personalization capability of the extended Trending Articles Trending article topics can be chosen up to three levels deep, and these topics are displayed based on user preferences.
- Custom Components: Custom Featured Articles component (Figure 10), Image Tiler component (Figure 7), Image Carousel component (Figure 6) are built from the ground up with personalization capabilities, as there were no existing components to extend.
9. Community User > Localized Support
The Napili Template provides a Live Agent Chat button component that could be added to community pages. The OOTB component needs to be pre-configured and doesn’t route users dynamically to different Agent Queues based on the region user belongs to.
To address this issue, a custom Lightning component is created as a wrapper on top of the OOTB standard Live Agent Chat button component. This wrapper component initializes and retrieves the configuration parameters (for Agent Queues) based on the current user locale and sets the parameters for the OOTB component dynamically.
10. Community User > Knowledge Article Classification
The Napili Template doesn’t have any community components to display Knowledge Article Data Categories in the Article Detail community page. This information is very important for users. To address this constraint, a custom Lightning component, Article Data Categories, was created to display the Data Categories (as shown in Figure 11) associated with any Article. The component is multilingual and displays the Data Categories based on the user profile. It is supported for both anonymous and authenticated users.
Salesforce Communities is revolutionizing the way companies engage with their customers and partners across all areas of the value chain. OOTB templates and community components are a great way to accelerate the rollout and provide a consistent user experience. There are some limitations in these templates in the context of the globally diversified organization. However, Salesforce provides an extensible platform to build custom Lightning components to address these constraints. With custom Lightning components, along with extended OOTB components, organizations can accelerate user adoption by personalizing content while improving the productivity of content and system administrators.
We hope this paper provides some ideas and inspiration to fellow community users, developers and implementers on how to maximize your investments in Salesforce Communities.
Docmation is a Salesforce Communities solution provider that brings together strong domain expertise, best creative talent, and passionate technologists to build awesome Salesforce Communities. Every day, we help organizations build communities that support critically important business goals across customer support, sales, marketing, and employee engagement. Our mission is to help you get more out of your communities’ investment and ensure communities add measurable value to your business.