Lightning Out
Add Help components to off-platform pages with Lightning Out host utility. This is a Visualforce page (IHLuxOutHost) that can create and display lightning components dynamically, allowing Lightning features to be exposed within non-Lightning environments, such as Salesforce Classic.
Use cases for Lightning Out include:
- Creation of local, custom Help Topic Templates that display Lightning Lists etc. embedded in Classic pages, or anywhere the Help Hook is used.
- Providing navigation direct to particular Lightning content, such as a specific Reading List, Image or Help Topic. For example, Lightning Out URLs could be included within the body of Help Topic or Notice rich text to facilitate linking to the desired content.
- Display of embedded help within Lightning itself: the Host is a Visualforce page and can add help hooks if desired.
URL builder mode
The Lightning Out Host page provides a basic interface that can be used to help obtain the correct URL parameters, as described elsewhere, to create Help Lightning Components.
To enter URL Builder mode, visit the Host page specifying only the following parameter: LOBuilder=true. With parameter, no component is built; instead, a design screen appears allowing to experiment with a subset of available components and settings.
Follow the on-screen instructions to construct URLs that will take you directly to the desired Help Lightning Components via Lightning Out.
The builder includes only a subset of the available components and parameters. However, the resulting URLs can be modified manually (e.g., by amending the Comp and Parms parameters) to build any Help component with any desired combination of settings.
Parameters
In common with the majority of Improved Apps’ Visualforce pages, the Lightning Out Host is controlled through the parameters sent to it via the URL
Note that all parameter names and values are case-sensitive. Details are provided in the topics related to this one.
HideHeader
Classic scenarios only: hide page header. Applicable only when the user visits the Lightning Out Host page from a Classic session (i.e., when not using the Lightning Experience).
- Set to “false” to show the classic Salesforce page header.
- Set any other value or none to suppress the header.
Parms
Supplies component-specific parameters to the generated item. Parameters (attribute information) to send to the component specified by Comp, in the form:
Attribute 1 Name ~ Attribute 1 Value ^ ... Attribute N Name ~ Attribute N Value
Spaces added for clarity only - do not use spaces when specifying parameters.
The Parms parameter is used to control the specifics of the component the Host is creating. The parameter names and values are case-sensitive and are exactly as listed for the specific components under ‘Design attributes’. For example, to specify that a component should display at a height of 200 pixels with header shown and footer hidden specify the following: Parms=Height~200^SuppressHeader~false^SuppressFooter~true.
Comp
The name of the component to create, from among those offered within the NSComp namespace.
To create a Help component, set NSComp to “iahelp” and Comp to the name of the desired component, as given in the preceding sections of this document For example:
- IHDetail = the Help Topic viewer.
- IHList = any Help listing (all Topics, related help, guides etc.)
- IHImageViewer = the Image Viewer
- IHRLViewer = the Reading List Viewer
HideSidebar
Classic scenarios only: hide page sidebar. Applicable only when the user visits the Lightning Out Host page from a Classic session (i.e., when not using the Lightning Experience). In addition, HideHeader must be set to “false”:
- Set to “false” to show the classic Salesforce page sidebar.
- Set any other value or none to suppress the sidebar.
NSComp
The namespace of the provider of the desired component.
The Host is able to create copies of its own Lightning Components or certain of those offered by Salesforce. Only components that are defined within the dependency app ( NSApp:App) can be created. Attempts to use any other components may fail.
- Set NSComp to “iahelp” when creating components from Improved Help.
- Set NSComp to the namespace of the provider of the desired component in other cases. Common values may include:
- aura
- force
- lightning
- ui
App
This is the name of the dependency app to reference. Used in conjunction with NSApp, this is the name of the dependency app to reference.
- To use the in-built dependency app (which will mostly be what is required) set App to “appIH”.
- To use a locally defined app, enter the name of that app.
NSApp
The NSApp parameter is the namespace of the dependency app to use. In order to create components reliably, Lightning Out requires a “dependency app”, akin to the manifest files used in languages such as C (The dependency app is an aura:application, which can be defined via developer console in the hosting org.) The App describes the resources that will be required: if these resources are not present, Lightning Out will fail gracefully (by not attempting to produce requested components) rather than creating objects that cannot be supported and could otherwise fail erratically as a consequence.
Improved Help includes a suitable dependency app but, in the interests of potential extensibility, the Lightning Out Host allows for one to be created locally and used when creating components. The NSApp parameter is the namespace of the dependency app to use.
- To use the in-built dependency app (which will mostly be what is required) specify the Improved Help namespace (iahelp).
- To use a locally defined app, one would typically specify “c” (similar to locally defined Help Topic Templates, where the page URLis entered as “c.VFPageName”)
Lightning Out
This section shows some example Lightning Out host URLs.
Carriage returns have been added to example URLs for clarity.
Replace {red text in braces}with values from your org.