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
Brian McGrath 4Brian McGrath 4 

force.com sites lightning components visual force page

Use case: develop and deploy a visual force page with lightning components to a force.com site.  The site is used by guest users (anonymous user) only.  We do not have Communities enables in our org.  I have seen some forum posts about this but no definitive answers or documentation references.  Is this use case feasible?
Divaker SinghDivaker Singh
Hi Brian,

Please check following URL this is lightening component and using in Visualforce page.
https://devtestlight-developer-edition.ap5.force.com/AccoDemo.

Using following code.
<apex:page sidebar="false" >
<apex:includeLightning />
<div id="lightning" />
<script>
$Lightning.use("c:VehicleListViewApp", function() { $Lightning.createComponent("c:VehicleListView", { label : "Press Me!" }, "lightning", function(cmp) { // do some stuff }); }); </script>
</apex:page>

C:c:VehicleListViewApp is a lightning app and c:VehicleListView is lightening component.
Brian McGrath 4Brian McGrath 4
Divaker, thanks for sending the AccDemo link.  We have resolved our issue.  A refresh of our sandbox from production, and re-establishing our objects and pages, resolved the issues.  We are now able to access custom object via VF Page with hosted Lightning Component/App, with force.com site as an anonymous user.  
Priya M 22Priya M 22
Hi Brain MCGrath 4,

Would you be able to help me out here please. I am newbee for Force.com site, i have similar issue which you have posted here accessing lightning component via visualforce page. Steps i have done so far created site,and one visualforce page. I have setup that page as active home page. I want to call or invoke the lightning component here. I dont know how to do that. your help will be highly appreciated.

thanks,
Priya