フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Ahmad Heba Tul Baseet
Page Meta Tages in Velocity!! Please Help
2012/10/30 2:29
答え

Ahmad Heba Tul Baseet

ランク: Junior Member

投稿: 70

参加年月日: 2011/05/12

最近の投稿

Hi all,
I wrote a portlet and in that Protlet, I wrote some meta Keywords with the help of PortalUtil.setPageKeywords(keyword, null);

Now I want to use this in my velocity theme. I cant do that. I tried every thing, but in vain. Can please somebody tell me, how I can use page Meta Keywords in velocity template. Is there any possibility. Thanks in advance
Bart Simpson
RE: Page Meta Tages in Velocity!! Please Help
2012/10/30 2:40
答え

Bart Simpson

ランク: Liferay Master

投稿: 524

参加年月日: 2011/08/29

最近の投稿

You have to get the layout (page) and then call method
1com.liferay.portal.model.LayoutModel.getDescription(String languageId)
Ahmad Heba Tul Baseet
RE: Page Meta Tages in Velocity!! Please Help
2012/10/30 3:26
答え

Ahmad Heba Tul Baseet

ランク: Junior Member

投稿: 70

参加年月日: 2011/05/12

最近の投稿

I need Keywords. Is there any getKeyword Method? I couuldn't find it. Thanks
Harish Kumar
RE: Page Meta Tages in Velocity!! Please Help
2012/10/30 3:43
答え

Harish Kumar

ランク: Expert

投稿: 471

参加年月日: 2010/07/31

最近の投稿

1com.liferay.portal.model.LayoutModel.getKeywords()
Bart Simpson
RE: Page Meta Tages in Velocity!! Please Help
2012/10/30 21:21
答え

Bart Simpson

ランク: Liferay Master

投稿: 524

参加年月日: 2011/08/29

最近の投稿

Bart Simpson:
You have to get the layout (page) and then call method
1com.liferay.portal.model.LayoutModel.getDescription(String languageId)

Oops sorry for the wrong method, the correct one is
1com.liferay.portal.model.LayoutModel.getKeywords()
Gaurav Jain
RE: Page Meta Tages in Velocity!! Please Help
2012/10/30 23:18
答え

Gaurav Jain

ランク: Regular Member

投稿: 146

参加年月日: 2011/01/31

最近の投稿

Ahmad Heba Tul Baseet:
I need Keywords. Is there any getKeyword Method? I couuldn't find it. Thanks


Hi Ahmad,
if you are setting page keywords using PortalUtil.setPageKeywords(keyword, request);
then you won't be able to access it using LayoutModel.getKeywords() as this one gets keywords of current page; while PortalUtil method just set the keywords in the request.

To access those keywords you may use in your theme velocity :
$request.getAttribute("LIFERAY_SHARED_PAGE_KEYWORDS")
where "LIFERAY_SHARED_PAGE_KEYWORDS" is actually constant in WebKeys as WebKeys.PAGE_KEYWORDS.

You may further check implementation of setPageKeywords method of PortalUtil in com.liferay.portal.util.PortalImpl.addPageKeywords(String keywords, HttpServletRequest request)
Ahmad Heba Tul Baseet
RE: Page Meta Tages in Velocity!! Please Help
2012/11/07 7:02
答え

Ahmad Heba Tul Baseet

ランク: Junior Member

投稿: 70

参加年月日: 2011/05/12

最近の投稿

Hi,

I solved it with the Javascript code....