Month: May 2019

Using Lightning Component in Communities

You can use a custom lightning component in your community, you can drag and drop to add the component to you community page in Community Builder

To appear in Community Builder, a component must implement the  interface forceCommunity:availableForAllPageTypes

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global">
    <aura:attribute name="greeting" type="String" default="Hello" access="global" />
    <aura:attribute name="subject" type="String" default="World" access="global" />
    
{!v.greeting}, {!v.subject}
</aura:component>

Mark your resources, such as a component, with access=”global” to make the resource usable outside of your own org.

NOTE – When you add custom components to your community, they can bypass the object- and field-level security (FLS) you set for the guest user profile. Lightning components don’t automatically enforce CRUD and FLS when referencing objects or retrieving the objects from an Apex controller. This means that the framework continues to display records and fields for which users don’t have CRUD permissions and FLS visibility. You must manually enforce CRUD and FLS in your Apex controllers.