Summer 20 Community Features for Developers
We decided to allocate Summer 20 Release features for the community development into a separate post. Here you can learn more about how to develop communities more efficiently using ExperienceBundle, Build Your Own LWC template, and scoped @salesforce/community modules.
1. Build Your Own LWC community template (Pilot)
Try out the NEW Build Your Own LWC template to develop a perfect community performance.
Build Your Own (LWC) is a minimal template that provides a few components and only the most essential pages. Based on the Lightning Web Components (LWC) it allows you to deliver fully customized LWC solutions.
So, if you are comfortable with developing lightning web components rather than Aura, this is just for you!
There’s only one thing – the feature is a pilot for this summer 20 release and may not be available on all orgs.
Enable the LWC template in Setup – Communities Settings – Enable the Build Your Own (LWC) template.
After you enable the template, it appears in the community creation wizard.
There are also a few more enhancements since the last dev release:
- Flexible layouts for pages so you can adjust the spacing between columns in the same way as in Aura communities.
- New Tile Menu and Rich Content Editor components.
Read more about Tile Menu and other new community features in our previous post – Top Summer 20 Release Features for Communities
- Salesforce modules now have more coherent behavior between Aura and LWC communities due to removing some limitations. Referential integrity is supported—for example, you no longer must republish the community when a content asset name changes. Also, the following @salesforce modules are now supported:
2. Retrieve the info about Lightning Community
Use the @salesforce/community scoped module to import information about the current community context when developing Lightning web components for Lightning communities.
Use @salesforce/community/Id to import the ID of the current community—for example, when your component must pass the community ID as a parameter to an API.
import communityId from ‘@salesforce/community/Id’;
Use @salesforce/community/basePath to import the base URL of your community and then dynamically construct the full URL—for example, when building a link component that works across several communities.
import communityBasePath from ‘@salesforce/community/basePath’;
3. Set up Theme Layout Properties in the ExperienceBundle
You can now easily update the Lightning Community theme layout via the ExperienceBundle.
Previously, theme layout properties such as hiding the header and navigation or setting the maximum page width were available only within the Experience Builder.
And now you can quickly configure appropriate theme layout settings in the theme_name.json files contained in the theme folder.