You need to sign in to do that
Don't have an account?
Sandeep Sahrawat
Pass URL Parameters to a Lightning Component inside a community.
1. I have used Salesforce Napili template to create a new Community.
2. I have created a new page in this template where I am exposing a new Lightning Component I created.
3. The lightning component accepts email and phone as two attributes.
4. These attributes should be passed to the lightning component embedded in the community as URL parameters. I am not able to do this today.
I would like to pass pass parameters to the lightning component inside community using URL parameter like:
http://<<communityURL>>/<<communityName>>?&email=rama@test.org&phone=999-999-9999
The email and phone parameters from the community URL should be passed to the component included in the community.
I know a way of doing this through lightning applications. I have seen this link:
http://salesforce.stackexchange.com/questions/106543/lightning-app-getting-url-parameter
But, my usecase is different. I don't have a lightning application. I only have a lightning component embedded in a Salesforce Lightning Community.
Please suggest, if this can be done.
2. I have created a new page in this template where I am exposing a new Lightning Component I created.
3. The lightning component accepts email and phone as two attributes.
4. These attributes should be passed to the lightning component embedded in the community as URL parameters. I am not able to do this today.
I would like to pass pass parameters to the lightning component inside community using URL parameter like:
http://<<communityURL>>/<<communityName>>?&email=rama@test.org&phone=999-999-9999
The email and phone parameters from the community URL should be passed to the component included in the community.
I know a way of doing this through lightning applications. I have seen this link:
http://salesforce.stackexchange.com/questions/106543/lightning-app-getting-url-parameter
But, my usecase is different. I don't have a lightning application. I only have a lightning component embedded in a Salesforce Lightning Community.
Please suggest, if this can be done.
I've been working on replacing the standard App Launcher componet in the community builder and wanted to get a url param to define the way the page is displayed, header and css etc.
I was able to add a function that gets the url params when the component loads and then set it to an attribute, here's a basic version of what worked for me.
Controller.js Component.cmp
hope this helps
All Answers
As far as I know, we can Pass Data From One Component to Another component by creating a lightning event.
Please refer below link for example.
https://www.forcetalks.com/blog/how-to-pass-data-from-one-component-to-another-in-salesforce-lightning/
and the other way as you said is lightning applications.
http://ofthecloud.blogspot.sg/2015/12/passing-url-parameters-to-controller-in.html
Hope this helps you!
Please mark it as solved if this helps you so that it will make available for other as a proper solution.
Thanks and Regards
Sandhya
I've been working on replacing the standard App Launcher componet in the community builder and wanted to get a url param to define the way the page is displayed, header and css etc.
I was able to add a function that gets the url params when the component loads and then set it to an attribute, here's a basic version of what worked for me.
Controller.js Component.cmp
hope this helps
Damon, I will try this on the weekend. Hopefully this should work..
Thanks
Sandeep Sahrawat
I have updated my post with another and simpler solution, you want to know another technique ,
http://ofthecloud.blogspot.sg/2015/12/passing-url-parameters-to-controller-in.html , see it.
I am using design properties to pass the values.
HTH
Prabhan;
Hello
I*m a real visual force rookie
Im not sure if this the right approach for me what you're have discussed here.
I would like to close the gap between Enterprise and Professional related to Dashboard Logged In User Feature in Lightning.
Is there any way to solve this with an Visual Force page in Lightning with the Professional Edition ?
I know that i can solve this really easy in classic with passing through the url ... but not in lightning
so where i have to begin ?
Any help is highly appreciated ...
thanks in advance
best regards john
https://salesforceblog.tumblr.com/post/178882204863/salesforce-navigation-from-lightning-component-to