Foros de discusión

Can Multiple Pages Share the Same Portlet Instance?

Phoenix Zerin, modificado hace 12 años.

Can Multiple Pages Share the Same Portlet Instance?

Junior Member Mensajes: 60 Fecha de incorporación: 28/06/11 Mensajes recientes
We're building a site where the content managers would like to be able to manage certain portlet settings at what they are calling the "section level". What this boils down to is that they want to be able to change configuration values for a certain portlet on a certain page, and they would like these changes reflected across several other pages (but not universally).

For example (contrived, but hopefully illustrative), consider a portlet with a setting that changes the portlet's background color.

Suppose that we have the following pages (the portlet's background color on that page follows the page name in this list):

+ Home        (green)
  + About     (blue)
  | + Contact (blue)
  + Products  (orange)
  | + AXL-900 (orange)
  | + VCC-218 (orange)
  + Support   (red)
  | + VIP     (gold)
  + Legal     (green)

Note that on several pages, the portlet has the same background color value. So far, that's easy enough; you just add a separate instance of the portlet to each page and set the configuration setting appropriately.

However, the content managers don't want to manage the background color on a per-page basis; they want to, for example, change the background color for the portlet on all the "About" pages to purple, all at the same time (this makes sense; it automates what would otherwise be a manual [and by definition, error-prone] process).

For this to work, the "About" and "Contact" pages, for example, would both have to use the same instance of the portlet... or they would have to have separate instances, but both instances would share the same configuration values. Or perhaps there is a different approach.

Is there a way to make this work?
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Can Multiple Pages Share the Same Portlet Instance? (Respuesta)

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
Have each portlet instance use a key, then look up the value bound to the key for the actual value to use.

"About" and "Contact" would share the same key, "color01", and "color01" is mapped to blue. When "color01" is mapped to green, all associated pages would be updated to use green rather than blue.
Ghenadii Ursachi, modificado hace 11 años.

RE: Can Multiple Pages Share the Same Portlet Instance?

New Member Mensaje: 1 Fecha de incorporación: 8/03/13 Mensajes recientes
Where do we store these key-value mappings?