Sharing Widgets with Other Sites
The Sharing options for widgets are deprecated as of Liferay 2024.Q4+ and are scheduled for removal in a future release.
You can share widgets with other sites by embedding a widget instance from your site into external platforms such as Facebook, OpenSocial, and Netvibes. This opens up a whole new avenue of exposure to your website that you would not have had otherwise.
![The Sharing tab in your widget's Configuration menu can share your widget in a variety of ways.](./ sharing-widgets-with-other-sites/images/01.png)
-
Start editing the page where the widget has been deployed.
-
Click Options () in the widget header → Configuration, then select the Sharing tab.
NoteBefore Liferay DXP 2025.Q1, the Configuration option appeared in the widget’s top-right corner.
-
There are three sub-tabs under sharing: Facebook, OpenSocial Gadget and Netvibes. Proceed according to the context you choose.
With any website, switch the toggle to allow the navigation. 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.
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.
Netvibes
Netvibes offers a similar environment where users can log in, create their own personal dashboards, and add customizable widgets to them.
Go to the Netvibes tab on the Sharing tab and enable the Allow users to add [application-name] to Netvibes pages. Use the provided URL to create a custom Netvibes widget based on your Liferay widget.