论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Phoenix Zerin
Can Multiple Pages Share the Same Portlet Instance?
2011年8月8日 下午2:16
答复

Phoenix Zerin

等级: Junior Member

帖子: 60

加入日期: 2011年6月28日

最近的帖子

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):

 1+ Home        (green)
 2  + About     (blue)
 3  | + Contact (blue)
 4  + Products  (orange)
 5  | + AXL-900 (orange)
 6  | + VCC-218 (orange)
 7  + Support   (red)
 8  | + VIP     (gold)
 9  + 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?
David H Nebinger
RE: Can Multiple Pages Share the Same Portlet Instance?
2011年8月9日 上午7:27
答复

David H Nebinger

Community Moderator

等级: Liferay Legend

帖子: 11770

加入日期: 2006年9月1日

最近的帖子

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
RE: Can Multiple Pages Share the Same Portlet Instance?
2013年3月8日 上午10:15
答复

Ghenadii Ursachi

等级: New Member

帖子: 1

加入日期: 2013年3月8日

最近的帖子

Where do we store these key-value mappings?