Setting Default Preferences for an Embedded Portlet

Follow these steps to set default portlet preferences for an embedded portlet:

  1. Retrieve portlet preferences using the freeMarkerPortletPreferences object. The example below retrieves the barebone:

    <#assign preferences = freeMarkerPortletPreferences.getPreferences(
      "portletSetupPortletDecoratorId", "barebone"
    ) />
  2. Set the defaultPreferences attribute of the embedded portlet to the freeMarkerPortletPreferences object you just configured:


Below are some additional attributes you can define for embedded portlets:

defaultPreferencesA string of Portlet Preferences for the application. This includes look and feel configurations.
instanceIdThe instance ID for the app, if the application is instanceable.
persistSettingsWhether to have an application use its default settings, which will persist across layouts. The default value is true.
settingsScopeSpecifies 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!

« Embedding a Portlet by Portlet NameImporting Resources with a Theme »