Follow these steps to set default portlet preferences for an embedded portlet:
-
Retrieve portlet preferences using the
freeMarkerPortletPreferences
object. The example below retrieves thebarebone
:<#assign preferences = freeMarkerPortletPreferences.getPreferences( "portletSetupPortletDecoratorId", "barebone" ) />
-
Set the
defaultPreferences
attribute of the embedded portlet to thefreeMarkerPortletPreferences
object you just configured:<@liferay_portlet["runtime"] defaultPreferences="${preferences}" portletName="com_liferay_login_web_portlet_LoginPortlet" />
Below are some additional attributes you can define for embedded portlets:
Preference | Description |
---|---|
defaultPreferences | A string of Portlet Preferences for the application. This includes look and feel configurations. |
instanceId | The instance ID for the app, if the application is instanceable. |
persistSettings | Whether to have an application use its default settings, which will persist across layouts. The default value is true. |
settingsScope | Specifies which settings to use for the application. The default value is portletInstance , but it can be set to group or company . |
Now you know how to set default preferences for embedded portlets!