Foren

Setting "layout specific" portlet preferences

Mikko Torri, geändert vor 12 Jahren.

Setting "layout specific" portlet preferences

Junior Member Beiträge: 33 Beitrittsdatum: 10.05.11 Neueste Beiträge
Hi

I'm wondering if there is a bug in 6.1 ga 1 regarding portlet preferences?

When ever I add a non-instantiable portlet to a page, the preferences are shared between all "instances" of the same portlet on different pages.
For example on page A is calendar portlet and on page B is also calendar portlet.
Setting display properties on page A causes the display properties on page B to change too.

This worked in 6.0.6.!

When looking at the database, I see that the portletpreferences table has multiple rows for portletid='8' (the calendar portlet) but the only row that gets updated is the row with ownertype=2 (group). In 6.0.6 the preferences were changed to ownertype =3 (layout).

Related to this I created this Jira entry about blog preferences being reset

Mikko
thumbnail
Dhrutika Parekh, geändert vor 12 Jahren.

RE: Setting "layout specific" portlet preferences

Expert Beiträge: 435 Beitrittsdatum: 09.02.09 Neueste Beiträge
Hi ,
You can overwrite liferay-portlet.xml of the portlet for which you want to set different preferences for different pages.

Set <preferences-unique-per-layout> false</preferences-unique-per-layout>

Hope this helps. For details see below description.
<!--
Set the preferences-unique-per-layout value to true if the preferences for the
portlet are unique across all pages. If set to false, the preferences for the
portlet are shared across all pages. The default value is true.

The preferences-unique-per-layout element is used in combination with the
preferences-owned-by-group element. See the comments for the
preferences-owned-by-group element for more information.
-->
<!ELEMENT preferences-unique-per-layout (#PCDATA)>

Regards,
Dhrutika
Mikko Torri, geändert vor 12 Jahren.

RE: Setting "layout specific" portlet preferences

Junior Member Beiträge: 33 Beitrittsdatum: 10.05.11 Neueste Beiträge
Thanks Dhrutika, it seems that preferences-unique-per-layout is set to false by default for the calendar portlet in 6.1.

Mikko