5

While working on a Lightning Component that can be invoked inside a Lightning Record Home Page as well as Quick Actions. But I need to present different User interface in both context of the component.

So when the Lightning Component is placed in Lightning Record Home Page it displays a Div containing some specific fields or text, while when the component is invoked from Quick Actions, it shows some other fields and text.

I've implemented following interfaces:

force:lightningQuickAction
flexipage:availableForRecordHome
force:hasRecordId

Is there a way I can detect the running context and Render (using aura:if) different set of container for each interface?

1
  • Detecting the context of a QuickAction for a component in general would be very useful, I agree. For your specific problem a base-class where common logic is shared could be the a good solution, so you extend the base-class and have 2 concrete implementations doing the visual stuff. So you can add the one component to the QuickAction and the second one to the home page. May 31, 2017 at 15:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.