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
alsinan nazimalsinan nazim 

Lightning Out VF Page in SF Customer Community

Hi,

I have a lightning app with a single component. I just integreted it into a VF page using Lightning Out dependency so that I can set that page as a community home page. But the div that has to create the component is not displaying in a guest user mode, and if we login as a community login user we are able to see the same. Other text and images in the VF page body is showing even without login.

My VF Page is shown below:

<apex:page applyBodyTag="false" applyHtmlTag="false" standardStylesheets="false" showHeader="false" sidebar="false" >
    <apex:includeLightning />
    <apex:includeScript value="/lightning/lightning.out.js"/>
<script>
    //Tell your Visualforce page to use NewMenuApp Lightning app
    $Lightning.use("c:TestCartApp", function() {
        // Write a function that creates the component on the page
        $Lightning.createComponent("c:TestCart",
                                   {},
                                   "myLightningApp",
                                   function(cmp) {      
                                   });
    });
    </script>
    <body>
        <div id="myLightningApp" />
    </body>   
</apex:page>

I need that div to be displayed to all users with the community URL without login.
Is there any other way we can display the same component in the page without user authentication, or any fix, workaround to acheive the same. Thank You.