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}

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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s