开发者

Is there a way to find out how many portlets are there in any page?

开发者 https://www.devze.com 2022-12-19 20:28 出处:网络
The problem is, say, i am having a page 开发者_开发知识库xyz. And in that page there are 20 portlets. How can i find out the names of all portlets placed on the page.

The problem is, say, i am having a page 开发者_开发知识库xyz. And in that page there are 20 portlets. How can i find out the names of all portlets placed on the page.

Provided i am having the admin privilege.


In Liferay the easiest way to do this is probably in the theme, you want to get a hold of the Layout object, that will let you explore the layout and pull references to the portlets on a page.

Some references:

  • http://www.liferay.com/community/wiki/-/wiki/Main/Layout%20Template#section-Layout+Template-AvailableVariablesInTemplate
  • http://docs.liferay.com/portal/5.2/javadocs/portal-service/com/liferay/portal/model/Layout.html


The two portlet standards (JSR-168 and JSR-286) don't specify any way of finding out the names of the portlets placed on the page.

But, it is possible that each portal provides a proprietary way of achieving what you want to do.

0

精彩评论

暂无评论...
验证码 换一张
取 消