function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vignesh S 50Vignesh S 50 

how to add Lightning page to Communities

I have created a login page using Aura Lightning. I want to add this page as my communitie page. But I have only the below three options to add  a page

1.Default Page
2.VisualForce Page
3.Experience builder page

Is there a any way to use my lightning page as my first login page instead of existing visualforcepage.

I have followed Setup>All Communities>Workspace>Login and Registration>LoginPageSetup
sachinarorasfsachinarorasf
Hi Vignesh,

I have gone through your problem. 

There is no way to use a direct Lightning page on your community. But you can use by through the Visualforce Page.
You can call the Lightning page on your Visualforce page and you can set the default page on your community.

You can use the below Visualforce page code for your reference: 


Visualforce Page:-

<apex:page sidebar="false" showHeader="false" standardStylesheets="false" >
    <apex:includeLightning />
    <div id="lightning"></div>
    <style>
    body{
        margin:0px;
        padding:0px;
        }
    </style>
    <script>
    $Lightning.use("c:CommunityLoginApp", function() {
        $Lightning.createComponent("c:CommunityLoginComponent",
                                   {},
                                   "lightning",
                                   function(cmp) {
                                       console.log('>>>>> App is hosted');
                                   });
    });
    </script>
</apex:page>

Application:-

<aura:application extends="ltng:outApp" access="global" implements="ltng:allowGuestAccess">
    <aura:dependency resource="c:CommunityLoginComponent" />
</aura:application>

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora