1

I add the language portlet in my liferay theme using this code:

#set ($VOID = $velocityPortletPreferences.setValue('portletSetupShowBorders', 'false'))
#set ($portlet_id = '82')
#set ($instance_id = "239abc678iuy")
#set ($my_portlet_id = "${portlet_id}_INSTANCE_${instance_id}")
$theme.runtime($my_portlet_id, "", $velocityPortletPreferences.toString())

in the portal_normal.vm.

I use the same theme in many pages. The problem is when I change the configuration of the language portlet (e.g. add or delete some languages) the modification is only applied to the current page, not to other pages.

Tobias Liefke
  • 8,637
  • 2
  • 41
  • 58
sedki
  • 25
  • 5

1 Answers1

0

The preferences for the language portlet are unique per layout, that means every page has its own configuration for this portlet.

There is a setting in the liferay-portlet.xml which controls that. It defaults to true, thats why it isn't mentioned in the section for the language portlet.

You have two options:

  1. Create an ext-plugin and redefine the language portlet in the liferay-portlet-ext.xml:

    <portlet>
        <portlet-name>82</portlet-name>
        <icon>/html/icons/language.png</icon>
        <struts-path>language</struts-path>
        <!-- ... copy of all other lines of portlet 82 from liferay-portlet.xml -->
        <preferences-unique-per-layout>false</preferences-unique-per-layout>
    </portlet>
    
  2. Create a hook plugin and create a service wrapper for the PortletLocalService, that returns a custom wrapper for portlet 82, that in the end returns false for preferencesUniquePerLayout.

Tobias Liefke
  • 8,637
  • 2
  • 41
  • 58