0

I want to add a lightning component in the layout of a record page of a community. Inside salesforce i have clicked edit page, and added the component. But i also want to expose it somehow in my community but it does not appear. Any ideas ?

  • 1
    add forceCommunity:availableForAllPageTypes interface – Sarvesh Apr 1 at 11:01
1

You should add interface or target symbol before you add any lightning component to Community page via Community Builder.

If you use Lightning Aura Component i.e. aura, addforceCommunity:availableForAllPageTypes:

<aura:component implements="forceCommunity:availableForAllPageTypes">
<!-- code -->
</aura:component>

If you use Lightning Web Component i.e. lwc, add<target>lightningCommunity__Page</target> to Component Configuration File:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>47.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightningCommunity__Page</target>
    </targets>
</LightningComponentBundle>

Friendly you can find more related information from Salesforce reference from aura or lwc

| improve this answer | |
  • Thanks for the solution!! – Giorgos Galaios Apr 1 at 14:34
  • Lol, he copied and improve it, booooh! – Pirata21 Apr 1 at 14:42
  • @Pirata21 I've worked on this part recently and also developed related code in a Salesforce IDE. Your answer includes the core of the solution but not is not friendly to anyone not familiar with Lightning. I cannot comment on your answer so I decide to write a more friendly version. Thanks for your support to the community. – Lushang Apr 15 at 12:43
1

You must have to specify it, on the metadata:

LWC: `

<isExposed>true</isExposed>
 <targets>
    <target> lightning__RecordPage </target>
 </targets>`

Aura:

<aura:component implements="flexipage:availableForRecordHome" access="global">
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.