Sharing Widgets with Other Sites
The Sharing options for widgets are deprecated as of Liferay DXP 2024.Q4/Portal GA129 and are scheduled for removal in a future release.
Currently, this feature is behind a deprecated feature flag (LPD-40534). Read Deprecated Feature Flags for more information.
You can share widgets with other sites by embedding a widget instance from your site into external platforms such as Facebook, and OpenSocial. This opens up a whole new avenue of exposure to your website that you would not have had otherwise.

-
Start editing the page where the widget has been deployed.
-
Click Options (
) in the widget header → Configuration, then select the Sharing tab. -
There are three sub-tabs under sharing: Any Website, Facebook, and OpenSocial. Proceed according to the context you choose.
Any Website
Copy and paste the provided snippet of JavaScript code into the website where you want to add the widget. When a user loads the page on the other website, the code pulls the relevant widget from your site and displays it.
Activating the toggle enables the Add to any Website option in the widget menu.
This feature is only available within a widget page.
The Add to any Website option provides an iframe code snippet for embedding the widget on external sites. When editing a page, click Options (
) in the widget header and select Add to Any Website.

To add a widget as a Facebook app, you must first obtain a developer key.
-
Go to the Facebook tab in the Sharing settings.
-
Retrieve the API Key and Canvas Page URL from Facebook and paste them into the Sharing tab.

-
Click Save and return to the Facebook tab in Liferay DXP. Copy the Callback URL and paste it into Facebook. This ensures the correct callback URL renders your app.
-
Optionally, enable Allow users to add [application-name] to Facebook. Then, in your app’s Options menu, select Add to Facebook.
OpenSocial Gadget
OpenSocial comprises a container and a set of APIs for social networking and other web applications. Liferay DXP can serve up applications to be used as OpenSocial Gadgets on any OpenSocial-compatible pages.
-
Copy the gadget URL from the OpenSocial Gadget tab and paste it into the relevant configuration page of the OpenSocial platform.
The URL provided is unique to the specific instance of the widget, so you could serve multiple instances of the same widget as different OpenSocial Gadgets.
-
Go to OpenSocial Gadget on the Sharing tab, and enable the selector Allow users to add [application-name] to an OpenSocial platform.
-
Click Save. A new Add to an OpenSocial Platform button appears in the widget options. Click it to obtain the URL for sharing the widget on an OpenSocial platform.