0

Is there a way to get Site.com custom property in Lightning code? Right now I am using custom property for every community (that reflects one site) but wondered if these could be moved to Site.com custom properties? I need to use the properties in components and their helpers.

I've tried $A.get("{!$Site.c.property_name}") and $A.get("{!$Site.property_name}") but none of those work. I've tried this for standard variables like $Site.BaseCusomUrl which according to Salesforce documentation should work for Force.com sites, but even that does not work.

2
  • I think visualforce global variables might not work in lightning component, try creating a property in apex class and pass the value to component.
    – Raul
    Dec 13 '16 at 8:19
  • That would mean traffic between lightning component and database which I want to avoid. Custom Settings can be used in this manner, but I am slightly against it. Instead of this I created Lightning component 'Global Settings' which has the properties accessible through design in the community builder and I put it into Header of the Site and I load the properties from this component.
    – JaKu
    Jan 11 '17 at 14:19

Your Answer

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

Browse other questions tagged or ask your own question.