Setting Widget Scopes
By default, Liferay’s page widgets are scoped by site, meaning all widget instances in a site share the same data and display the same content. For example, adding the Message Boards widget to two pages within the same site creates two instances using the same data. However, adding the widget to two different sites results in two independent instances with different data.
You can also scope widget instances to individual pages, allowing each widget to have its own data.
Liferay provides three scope options for page widgets:
Scope | Description |
---|---|
Default | Scopes widget data to the current site. |
Global | Scopes widget data to the Global site, with content management restricted to the Global site. |
Page | Scopes widget data to a specific page. Once created, this scope can be used across different widgets, even on different pages. |
To configure a widget’s scope,
-
Start editing the page where the widget has been deployed.
-
Click Options () in the widget header → Configuration, then select the Scope tab.
NoteBefore Liferay DXP 2025.Q1, the Configuration option appeared in the widget’s top-right corner.
-
Use the drop-down menu to select a scope.
This menu includes the current site (e.g., Liferay DXP. The current site refers to the default scope), the Global site, the current page, and any other page scopes available in the site.
If you haven’t created a scope for the current page, its name is followed by
(Create New)
(e.g., Home (Create New)). -
Click Save.
After creating a new widget scope, a Scope Configuration button () appears under Content & Data in the Site Menu (). You can use this to manage the default scope or available page scopes.
You can only delete a scope by deleting its associated page.